本文整理汇总了PHP中Entity::GetFirstResult方法的典型用法代码示例。如果您正苦于以下问题:PHP Entity::GetFirstResult方法的具体用法?PHP Entity::GetFirstResult怎么用?PHP Entity::GetFirstResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entity
的用法示例。
在下文中一共展示了Entity::GetFirstResult方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Retrieve
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__);
}
示例2: Retrieve
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;
}
示例3: Retrieve
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;
}
示例4: Retrieve
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;
}
示例5: Retrieve
/**
* 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;
}
示例6: RetrieveByFile
static function RetrieveByFile($file)
{
$query = "SELECT * FROM image WHERE file = ?";
$entity = new Entity();
return $entity->GetFirstResult($query, $file, __CLASS__);
}