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