protected function setForeignConstraintFromArray(array $properties)
    {
        $foreignConstraint = $this->getForeignConstraintFromArray($properties);

        $this->setForeignConstraint($foreignConstraint);

        if ($this->hasForeignConstraint() && !$this->hasForeignRelation()) {
            $this->setForeignRelation($foreignConstraint->getForeignRelation());
        }

        return $this;
    }
protected function setForeignConstraintFromArray(array $properties)
    {
        $foreignConstraint = $this->getForeignConstraintFromArray($properties);

        $this->setForeignConstraint($foreignConstraint);

        if ($this->hasForeignConstraint() && !$this->hasForeignRelation()) {
            $this->setForeignRelation($foreignConstraint->getForeignRelation());
        }

        return $this;
    }
protected function setForeignConstraintFromArray ( array $ properties ) { $ foreignConstraint = $ this -> getForeignConstraintFromArray ( $ properties ) ; $ this -> setForeignConstraint ( $ foreignConstraint ) ; if ( $ this -> hasForeignConstraint ( ) && ! $ this -> hasForeignRelation ( ) ) { $ this -> setForeignRelation ( $ foreignConstraint -> getForeignRelation ( ) ) ; } return $ this ; }
Sets the foreign key for a given field

@param array $properties

@return $this
Sets the foreign key for a given field