示例#1
0
 /**
  * Create a new Relation instance.
  *
  * @param \Vinelab\NeoEloquent\Eloquent\Builder $query
  * @param \Vinelab\NeoEloquent\Eloquent\Model   $parent
  * @param \Vinelab\NeoEloquent\Eloquent\Model   $related
  * @param string  $type
  */
 public function __construct(Builder $query, Model $parent, Model $related, $type, $attributes = array(), $unique = false)
 {
     parent::__construct($query);
     $this->type = $type;
     $this->parent = $parent;
     $this->related = $related;
     $this->unique = $unique;
     $this->attributes = $attributes;
     $this->finder = $this->newFinder();
     $this->initRelation();
 }
示例#2
0
 /**
  * Create a new Finder instance.
  *
  * @param \Vinelab\NeoEloquent\Eloquent\Builder $query
  * @param \Vinelab\NeoEloquent\Eloquent\Model   $parent
  * @param \Vinelab\NeoEloquent\Eloquent\Model   $related
  * @param string  $type
  */
 public function __construct(Builder $query)
 {
     parent::__construct($query);
 }