Lazer\Classes\Helpers\Validate::relationType PHP Method

relationType() public static method

Checking that relation type is correct
public static relationType ( string $type ) : boolean
$type string
return boolean relation type
    public static function relationType($type)
    {
        if (in_array($type, Relation::relations())) {
            return true;
        }
        throw new LazerException('Wrong relation type');
    }

Usage Example

Esempio n. 1
0
 /**
  * Set relation type to field
  * @param string $relation Name of relation
  */
 protected function setRelationType($relation)
 {
     Validate::relationType($relation);
     $this->relationType = $relation;
 }
All Usage Examples Of Lazer\Classes\Helpers\Validate::relationType