LMongo\Eloquent\Relations\HasOneOrMany::__construct PHP Method

__construct() public method

Create a new has many relationship instance.
public __construct ( Builder $query, Model $parent, string $foreignKey ) : void
$query LMongo\Eloquent\Builder
$parent LMongo\Eloquent\Model
$foreignKey string
return void
    public function __construct(Builder $query, Model $parent, $foreignKey)
    {
        $this->foreignKey = $foreignKey;
        parent::__construct($query, $parent);
    }

Usage Example

Beispiel #1
0
 /**
  * Create a new has many relationship instance.
  *
  * @param  \LMongo\Eloquent\Builder  $query
  * @param  \LMongo\Eloquent\Model  $parent
  * @param  string  $foreignKey
  * @param  string  $otherKey
  * @return void
  */
 public function __construct(Builder $query, Model $parent, $foreignKey, $otherKey)
 {
     $this->otherKey = $otherKey;
     $this->foreignKey = $foreignKey;
     parent::__construct($query, $parent, $foreignKey);
 }
All Usage Examples Of LMongo\Eloquent\Relations\HasOneOrMany::__construct