예제 #1
0
 public function scopeWithSubtreeById($q, $v = null)
 {
     if (!$v) {
         return $q;
     } else {
         $root = Static::find($v);
         if ($root->id) {
             return $q->pathLike($root->{Static::getPathField()} . $root->{Static::getPathField()} . '*');
         } else {
             return $q;
         }
     }
 }