LMongo\Eloquent\Relations\HasOneOrMany::addConstraints PHP Méthode

addConstraints() public méthode

Set the base constraints on the relation query.
public addConstraints ( ) : void
Résultat void
    public function addConstraints()
    {
        $key = $this->parent->getKey();
        $this->query->where($this->foreignKey, new MongoID((string) $key));
    }

Usage Example

Exemple #1
0
 /**
  * Set the base constraints on the relation query.
  *
  * @return void
  */
 public function addConstraints()
 {
     parent::addConstraints();
     $this->query->where($this->morphType, $this->morphClass);
 }