コード例 #1
0
 /**
  * Get the children.
  *
  * @return \Luminous\Bridge\Post\Query\Builder
  */
 protected function getChildrenAttribute()
 {
     return WP::posts($this->type)->wherePost('parent_id', $this->id);
 }
コード例 #2
0
 /**
  * Get the older post.
  *
  * @return \Luminous\Bridge\Post\Entity|null
  */
 public function getOlderAttribute()
 {
     return WP::posts($this->type)->whereDate('created_at', '<', $this->created_at)->orderBy('created_at', 'desc')->first();
 }