public static function getFrom($condition, $model) {
        if (is_a($condition, '\\mpf\datasources\\sql\\ModelCondition')) {
            $condition->model = $model;
            return $condition;
        }
        if (is_array($condition) && count($condition))
            $cond = new static($condition);
        else {
            $cond = new static;
            if ($condition)
                $cond->addCondition($condition);
        }
        $cond->model = $model;
        return $cond;
    }
public static function getFrom($condition, $model) {
        if (is_a($condition, '\\mpf\datasources\\sql\\ModelCondition')) {
            $condition->model = $model;
            return $condition;
        }
        if (is_array($condition) && count($condition))
            $cond = new static($condition);
        else {
            $cond = new static;
            if ($condition)
                $cond->addCondition($condition);
        }
        $cond->model = $model;
        return $cond;
    }
public static function getFrom ( $ condition , $ model ) { if ( is_a ( $ condition , '\\mpf\datasources\\sql\\ModelCondition' ) ) { $ condition -> model = $ model ; return $ condition ; } if ( is_array ( $ condition ) && count ( $ condition ) ) $ cond = new static ( $ condition ) ; else { $ cond = new static ; if ( $ condition ) $ cond -> addCondition ( $ condition ) ; } $ cond -> model = $ model ; return $ cond ; }
Get ModelCondition or subclass from a condition that can be string or array
or another condition object, in wich case it will return that object;
@param mixed $condition The original condition
@return static
Get ModelCondition or subclass from a condition that can be string or array or another condition object in wich case it will return that object ;