Example #1
0
 function GetKids()
 {
     $entity = new Entity();
     $query = "SELECT * FROM #__categories WHERE parent = ? ORDER BY ordering";
     $objects = $entity->Collection($query, $this->id, __CLASS__);
     return $objects;
 }
Example #2
0
 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;
 }
Example #3
0
 /**
  * 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);
 }