This commit is contained in:
Romain Neutron
2012-04-26 00:55:53 +02:00
parent edbfff226e
commit ade22295ad
631 changed files with 92375 additions and 101763 deletions

View File

@@ -17,152 +17,150 @@
*/
abstract class Bridge_Api_AbstractCollection
{
/**
*
* @var int
*/
protected $total_page = 1;
/**
*
* @var int
*/
protected $total_page = 1;
/**
*
* @var int
*/
protected $current_page = 1;
/**
*
* @var int
*/
protected $current_page = 1;
/**
*
* @var int
*/
protected $total_items;
/**
*
* @var int
*/
protected $total_items;
/**
*
* @var int
*/
protected $items_per_page;
/**
*
* @var int
*/
protected $items_per_page;
/**
*
* @var Array
*/
protected $elements = array();
/**
*
* @var Array
*/
protected $elements = array();
/**
*
* @return int
*/
public function get_total_items()
{
return $this->total_items;
}
/**
*
* @return int
*/
public function get_total_items()
{
return $this->total_items;
}
public function set_total_items($total_items)
{
$this->total_items = (int) $total_items;
public function set_total_items($total_items)
{
$this->total_items = (int) $total_items;
return $this;
}
return $this;
}
/**
*
* @return int
*/
public function get_items_per_page()
{
return $this->items_per_page;
}
/**
*
* @return int
*/
public function get_items_per_page()
{
return $this->items_per_page;
}
/**
*
* @param int $items_per_page
* @return Bridge_Api_AbstractCollection
*/
public function set_items_per_page($items_per_page)
{
$this->items_per_page = (int) $items_per_page;
/**
*
* @param int $items_per_page
* @return Bridge_Api_AbstractCollection
*/
public function set_items_per_page($items_per_page)
{
$this->items_per_page = (int) $items_per_page;
return $this;
}
return $this;
}
/**
*
* @return int
*/
public function get_current_page()
{
return $this->current_page;
}
/**
*
* @return int
*/
public function get_current_page()
{
return $this->current_page;
}
/**
*
* @param int $current_page
* @return Bridge_Api_AbstractCollection
*/
public function set_current_page($current_page)
{
if ($current_page > 0)
$this->current_page = (int) $current_page;
/**
*
* @param int $current_page
* @return Bridge_Api_AbstractCollection
*/
public function set_current_page($current_page)
{
if ($current_page > 0)
$this->current_page = (int) $current_page;
return $this;
}
return $this;
}
/**
*
* @return int
*/
public function get_total_page()
{
return $this->total_page;
}
/**
*
* @return int
*/
public function get_total_page()
{
return $this->total_page;
}
/**
*
* @param int $total_page
* @return Bridge_Api_AbstractCollection
*/
public function set_total_page($total_page)
{
if ($total_page > 0)
$this->total_page = (int) $total_page;
/**
*
* @param int $total_page
* @return Bridge_Api_AbstractCollection
*/
public function set_total_page($total_page)
{
if ($total_page > 0)
$this->total_page = (int) $total_page;
return $this;
}
return $this;
}
/**
*
* @return boolean
*/
public function has_next_page()
{
return $this->current_page < $this->total_page;
}
/**
*
* @return boolean
*/
public function has_next_page()
{
return $this->current_page < $this->total_page;
}
/**
*
* @return boolean
*/
public function has_previous_page()
{
return $this->current_page > 1;
}
/**
*
* @return boolean
*/
public function has_previous_page()
{
return $this->current_page > 1;
}
/**
*
* @return boolean
*/
public function has_more_than_one_page()
{
return $this->total_page > 1;
}
/**
*
* @return Array
*/
public function get_elements()
{
return $this->elements;
}
/**
*
* @return boolean
*/
public function has_more_than_one_page()
{
return $this->total_page > 1;
}
/**
*
* @return Array
*/
public function get_elements()
{
return $this->elements;
}
}