Exemplo n.º 1
0
 static function Retrieve($user_id, $cfg_name)
 {
     if (!$user_id || !$cfg_name) {
         return null;
     }
     $entity = new Entity();
     $query = "SELECT * FROM #__messages_cfg WHERE user_id = ? AND cfg_name = ?";
     return $entity->GetFirstResult($query, array($user_id, $cfg_name), __CLASS__);
 }
Exemplo n.º 2
0
 static function Retrieve($category_id)
 {
     if (!$category_id) {
         return null;
     }
     $entity = new Entity();
     $query = "SELECT * FROM #__categories WHERE id = ?";
     $object = $entity->GetFirstResult($query, $category_id, __CLASS__);
     return $object;
 }
Exemplo n.º 3
0
 static function Retrieve($id)
 {
     if (!$id) {
         return null;
     }
     $entity = new Entity();
     $query = "SELECT * FROM #__content WHERE id = ?";
     $object = $entity->GetFirstResult($query, $id, __CLASS__);
     if (!$object->id) {
         return null;
     }
     return $object;
 }
 static function Retrieve($id)
 {
     if (!$id) {
         return null;
     }
     $entity = new Entity();
     $query = "SELECT * FROM #__contact_details WHERE id = ?";
     $object = $entity->GetFirstResult($query, $id, __CLASS__);
     if (!$object) {
         return null;
     }
     $object->user = User::Retrieve($object->user_id);
     return $object;
 }
Exemplo n.º 5
0
 /**
  * Retrieve row from database where id = $id ( or id => $id_name  )
  * @param int $id
  * @param string $id_name
  * @param string $class
  * @return object
  * Returns object type of entity
  */
 static function Retrieve($id, $class = __CLASS__)
 {
     if (!$id) {
         return null;
     }
     $object = new $class();
     $object->BuildSchema();
     $entity = new Entity();
     $query = "SELECT * FROM `{$object->table_name}` WHERE `{$object->id_name}` = ? LIMIT 1";
     $object = $entity->GetFirstResult($query, $id, $class);
     if (!$object) {
         return null;
     }
     return $object;
 }
Exemplo n.º 6
0
 static function RetrieveByFile($file)
 {
     $query = "SELECT * FROM image WHERE file = ?";
     $entity = new Entity();
     return $entity->GetFirstResult($query, $file, __CLASS__);
 }