本文整理汇总了PHP中ORM::find_all方法的典型用法代码示例。如果您正苦于以下问题:PHP ORM::find_all方法的具体用法?PHP ORM::find_all怎么用?PHP ORM::find_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ORM
的用法示例。
在下文中一共展示了ORM::find_all方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: paginate
/**
* Accepts an ORM instance with query parameters set and returns the
* current page of results e.g.,
*
* $query = ORM::factory('customer')->where('status', 'approved);
* $pages = new Pagination();
* $results = $pages->paginate($query);
*
* @param object ORM
* @return object ORM_Iterator
*/
public function paginate(ORM $query)
{
// Work out what page we're currently on and set the SQL offsets
// appropriately.
//
// This is necessary because if you create a Pagination object
// without specifying the total pages, then current page is
// always set to 1.
$this->determine_current_page();
// Find the current page of results
$results = $query->find_all($this->items_per_page, $this->sql_offset);
// Set the correct total_item count
$this->total_items = $query->count_last_query();
// Re-initialize to ensure all values are set correctly
$this->initialize();
return $results;
}
示例2: find_all
/**
* Finds multiple database rows and returns an iterator of the rows found.
*
* @chainable
* @param integer SQL limit
* @param integer SQL offset
* @return ORM_Iterator
*/
public function find_all($limit = NULL, $offset = NULL)
{
if (Kohana::config('versions.version') == 'max') {
$w = new Database_Expression('(SELECT max(version) FROM ' . $this->table_name . ' AS q WHERE ' . $this->table_name . '.pid=q.pid)');
} else {
$v = versions_helper::get_published_version();
$w = new Database_Expression('(SELECT max(version) FROM ' . $this->table_name . ' AS q WHERE ' . $this->table_name . '.pid=q.pid AND version <= ' . $v . ')');
}
$this->db->where('version', $w);
$this->db->where('state!=', 'D');
return parent::find_all($limit, $offset);
}
示例3: find_all
/**
* The find_all override enforces that the grid view only shows public triggers or triggers created by this user,
* and also filters the subscriber information to this user only. A bit too complex for base filter and auth
* filter techniques.
*/
public function find_all($limit = NULL, $offset = NULL)
{
$this->in('private_for_user_id', array(null, $_SESSION['auth_user']->id));
return parent::find_all($limit, $offset);
}
示例4: find_all
/**
* Override the find_all method
*
* @see Gleez_ORM_Core::find_all
*/
public function find_all($id = NULL)
{
$this->where($this->_object_name . '.id', '!=', User::GUEST_ID);
return parent::find_all($id);
}
示例5: find_all
/**
* Wrap Idiorm's find_all method to return
* an array of instances of the class associated
* with this wrapper instead of the raw ORM class.
*/
public function find_all()
{
return array_map(array($this, '_create_model_instance'), parent::find_all());
}
示例6: find_all
/**
* Model_Base::find_all()
* apply filters and sorts before find all
*
* @return
*/
public function find_all()
{
$this->apply_filters();
$this->apply_sorts();
$this->apply_amount();
$this->apply_skip();
return parent::find_all();
}
开发者ID:yubinchen18,项目名称:A-basic-website-project-for-a-company-using-the-MVC-pattern-in-Kohana-framework,代码行数:14,代码来源:Base.php
示例7: find_all
public function find_all()
{
$this->where('prefix', '!=', Model_Location::RESERVED_LOCATION);
return parent::find_all();
}