本文整理汇总了PHP中Entity::Collection方法的典型用法代码示例。如果您正苦于以下问题:PHP Entity::Collection方法的具体用法?PHP Entity::Collection怎么用?PHP Entity::Collection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entity
的用法示例。
在下文中一共展示了Entity::Collection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetKids
function GetKids()
{
$entity = new Entity();
$query = "SELECT * FROM #__categories WHERE parent = ? ORDER BY ordering";
$objects = $entity->Collection($query, $this->id, __CLASS__);
return $objects;
}
示例2: LatestCollection
static function LatestCollection($limit = 5)
{
$entity = new Entity();
$query = "SELECT * FROM #__content WHERE state = 1 ORDER BY id DESC LIMIT ?";
$objects = $entity->Collection($query, $limit, __CLASS__);
if (!$objects[0]->id) {
return null;
}
/*
foreach( $objects as $object )
{
$collection = self::Retrieve( $object->id );
}*/
return $objects;
}
示例3: GetAll
/**
* Gets all entries from database
* @param $class string class name
*/
static function GetAll($class = null)
{
if (!$class) {
JError::raiseError("Entity::GetAll - class name cannot be null.");
}
$object = new $class();
$query = "SELECT * from `{$object->table_name}`";
$entity = new Entity();
return $entity->Collection($query, null, $class);
}