public static function getInstance(Model $model, $attribute)
    {
        foreach ($model->behaviors as $behavior) {
            if ($behavior instanceof self && $behavior->attribute == $attribute) {
                return $behavior;
            }
        }

        throw new InvalidCallException('Missing behavior for attribute ' . VarDumper::dumpAsString($attribute));
    }
public static function getInstance(Model $model, $attribute)
    {
        foreach ($model->behaviors as $behavior) {
            if ($behavior instanceof self && $behavior->attribute == $attribute) {
                return $behavior;
            }
        }

        throw new InvalidCallException('Missing behavior for attribute ' . VarDumper::dumpAsString($attribute));
    }
public static function getInstance ( Model $ model , $ attribute ) { foreach ( $ model -> behaviors as $ behavior ) { if ( $ behavior instanceof self && $ behavior -> attribute == $ attribute ) { return $ behavior ; } } throw new InvalidCallException ( 'Missing behavior for attribute ' . VarDumper :: dumpAsString ( $ attribute ) ) ; }
Returns behavior instance for specified object and attribute

@param Model $model
@param string $attribute
@return static
Returns behavior instance for specified object and attribute