# css-javascript-toolbox/7.1.1/models/block/assignmentpanel/post.php

CSS &amp; JavaScript Toolbox, version 7.1.1. 63 lines.

- Page: https://pluginprobe.com/plugins/css-javascript-toolbox/7.1.1/code/models/block/assignmentpanel/post.php
- Raw: https://pluginprobe.com/plugins/css-javascript-toolbox/7.1.1/raw/models/block/assignmentpanel/post.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/7.1.1/code/models/block/assignmentpanel/post.php#L10-L20`.

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

/**
* 
*/
class CJT_Models_Block_Assignmentpanel_Post
extends CJT_Models_Block_Assignmentpanel_Postbase {

	/**
	* put your comment there...
	* 
	*/
	public function getTotalCount() {
		// Initialize.
		$args = $this->args;
		$params =& $this->getTypeParams();
		// Set args.
		$args['offset'] = 0;
		$args['numberposts'] = -1;
		$args['post_type'] = $params['type'];
		// Query posts.
		return count(get_posts($args));
	}

	/**
	* put your comment there...
	* 
	*/
	protected function isHierarchical() {
		// Initialize.
		$typeParams =& $this->getTypeParams();
		// Check if post_type hierarchical.
		return is_post_type_hierarchical($typeParams['type']);
	}

  /**
  * put your comment there...
  * 
  *
  */
  protected function queryItems() {
		// Initialize.
		$args = $this->args;
		$params =& $this->getTypeParams();
		// Set User passed parameters used to query 'posts'
		if ($this->isHierarchical()) {
			// Fetch all for Hierarchical posts.
			$args['offset'] = 0;
			$args['numberposts'] = -1;
		}
		else {
			$args['offset'] = $this->getOffset();
			$args['numberposts'] = $this->getIPerPage();
		}
		$args['post_type'] = $params['type'];
		// Query posts.
		return get_posts($args);
  }

} // End class.
```
