Phalcon\Mvc\Model\EagerLoading\Loader::from PHP Method

from() public static method

Create and get from a mixed $subject
public static from ( Phalcon\Mvc\ModelInterface | Phalcon\Mvc\ModelInterface[] | Phalcon\Mvc\Model\Resultset\Simple $subject ) : mixed
$subject Phalcon\Mvc\ModelInterface | Phalcon\Mvc\ModelInterface[] | Phalcon\Mvc\Model\Resultset\Simple
return mixed
    public static function from($subject)
    {
        if ($subject instanceof ModelInterface) {
            $ret = call_user_func_array('static::fromModel', func_get_args());
        } elseif ($subject instanceof Simple) {
            $ret = call_user_func_array('static::fromResultset', func_get_args());
        } elseif (is_array($subject)) {
            $ret = call_user_func_array('static::fromArray', func_get_args());
        } else {
            throw new \InvalidArgumentException(static::E_INVALID_SUBJECT);
        }
        return $ret;
    }