本文整理汇总了PHP中Repository::findSingle方法的典型用法代码示例。如果您正苦于以下问题:PHP Repository::findSingle方法的具体用法?PHP Repository::findSingle怎么用?PHP Repository::findSingle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Repository
的用法示例。
在下文中一共展示了Repository::findSingle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: findSingle
/**
* @return Permission|false
*/
public function findSingle()
{
$result = parent::findSingle();
if ($result) {
return new Permission($result);
} else {
return false;
}
}
示例2: findSingle
/**
* @return Author|false
*/
public function findSingle()
{
$result = parent::findSingle();
if ($result) {
return new Author($result);
} else {
return false;
}
}
示例3: findSingle
/**
* @param bool $full
*
* @return Role|false
*/
public function findSingle($full = false)
{
$result = parent::findSingle();
if ($result) {
$role = new Role($result);
if ($full === true) {
$repo = new PermissionRepository($this->db);
$role->setPermissions($repo->where('role_id', '=', $role->getId())->order('name', 'ASC')->find());
}
return $role;
} else {
return false;
}
}
示例4: findSingle
/**
* @param bool $full
*
* @return Publication|false
*/
public function findSingle($full = false)
{
$result = parent::findSingle();
if ($result) {
$publication = new Publication($result);
$repo = new AuthorRepository($this->db);
$publication->setAuthors($repo->where('publication_id', '=', $publication->getId())->order('priority', 'ASC')->find());
$repo = new FileRepository($this->db);
$publication->setFiles($repo->where('publication_id', '=', $publication->getId())->find());
$repo = new UrlRepository($this->db);
$publication->setUrls($repo->where('publication_id', '=', $publication->getId())->find());
if ($full === true) {
$repo = new KeywordRepository($this->db);
$publication->setKeywords($repo->where('publication_id', '=', $publication->getId())->order('name', 'ASC')->find());
$repo = new CitationRepository($this->db);
$publication->setCitations($repo->where('publication_id', '=', $publication->getId())->find());
}
return $publication;
} else {
return false;
}
}