本文整理汇总了PHP中Links::query方法的典型用法代码示例。如果您正苦于以下问题:PHP Links::query方法的具体用法?PHP Links::query怎么用?PHP Links::query使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Links
的用法示例。
在下文中一共展示了Links::query方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: links
public function links()
{
if (null == $this->links) {
$this->links = Links::query()->where('linkable_type = :type:', ['type' => get_class($this)])->andWhere('linkable_id = :id:', ['id' => $this->id])->execute();
}
return $this->links;
}
示例2: getLinksInfo
public function getLinksInfo()
{
if (null == $this->linksInfo) {
$this->linksInfo = Links::query()->leftJoin('Movies', 'Links.linkable_id = Movies.id AND Links.linkable_type = "Movies"')->where('site_id = :site_id:', ['site_id' => $this->id])->columns(['Links.id', 'Links.url', 'Links.note', 'Links.linkable_id AS movie_id', 'Links.created_at', 'Movies.title'])->orderBy('Links.updated_at DESC')->execute();
}
return $this->linksInfo;
}
示例3: links
public function links()
{
if (null == $this->links) {
$this->links = Links::query()->where('user_id = :user:', ['user' => $this->id])->leftJoin('Movies', 'Movies.id = Links.movie_id')->leftJoin('Sites', 'Sites.id = Links.site_id')->columns(['Links.id', 'Links.url', 'Links.created_at', 'Links.user_id', 'Sites.name AS siteName', 'Sites.id AS siteId', 'Movies.title AS movieTitle', 'Movies.id AS movieId'])->orderBy('Links.created_at DESC')->execute();
}
return $this->links;
}