# css-javascript-toolbox/8.0.2/models/block/assignmentpanel/postpinned.php

CSS &amp; JavaScript Toolbox, version 8.0.2. 69 lines.

- Page: https://pluginprobe.com/plugins/css-javascript-toolbox/8.0.2/code/models/block/assignmentpanel/postpinned.php
- Raw: https://pluginprobe.com/plugins/css-javascript-toolbox/8.0.2/raw/models/block/assignmentpanel/postpinned.php
- Modified: 2013-10-04T22:35:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/css-javascript-toolbox/8.0.2/code/models/block/assignmentpanel/postpinned.php#L10-L20`.

```php
<?php
/**
* 
*/

/**
* 
*/
class CJT_Models_Block_Assignmentpanel_Postpinned
extends CJT_Models_Block_Assignmentpanel_Postbase {

	/**
	* put your comment there...
	* 
	*/
	public function getTotalCount() {
		return count($this->getPinsMap());
	}

	/**
	* put your comment there...
	* 
	*/
	protected function isHierarchical() {
		return false;
	}

	/**
	* put your comment there...
	* 
	* @param mixed $key
	* @param mixed $item
	*/
	protected function prepareItem($key, & $item) {
		// Prepare item.
		parent::prepareItem($key, $item);
		// No parents used in assignedOnly items.
		$item['parent'] = 0;
	}

  /**
  * put your comment there...
  * 
  *
  */
  protected function queryItems() {
  	// All assigned items is fetched in the first request
  	// Multiple requestes is now allowed.
  	if ($this->getOffset()) {
			return array();
  	}
  	// Initialize.
  	$params = $this->getTypeParams();
  	// Get all assigned IDs.
  	$ids = array_keys($this->getPinsMap());
  	// Query all available Ids.
  	$args = $this->args;
  	$args['post_type'] = $params['type'];
  	$args['post__in'] = $ids;
		$args['offset'] = $this->getOffset();
		$args['numberposts'] = -1;
  	// Return empty list if nothing assigned
  	// or the queried items otherwise.
  	$items = empty($ids) ? array() : get_posts($args);
  	// Returns.
  	return $items;
  }

} // End class.
```
