PHP Class Phalcon\Mvc\Model\EagerLoading\Loader

Show file Open project: phalcon/incubator Class Usage Examples

Protected Properties

Property Type Description
$eagerLoads array
$mustReturnAModel boolean
$subject Phalcon\Mvc\ModelInterface[]
$subjectClassName string

Public Methods

Method Description
__construct ( Phalcon\Mvc\ModelInterface | Phalcon\Mvc\ModelInterface[] | Phalcon\Mvc\Model\Resultset\Simple $from )
addEagerLoad ( string $relationAlias, null | callable $constraints = null )
execute ( )
from ( Phalcon\Mvc\ModelInterface | Phalcon\Mvc\ModelInterface[] | Phalcon\Mvc\Model\Resultset\Simple $subject ) : mixed Create and get from a mixed $subject
fromArray ( array $subject ) : array Create and get from an array
fromModel ( Phalcon\Mvc\ModelInterface $subject ) : Phalcon\Mvc\ModelInterface Create and get from a Model
fromResultset ( Phalcon\Mvc\Model\Resultset\Simple $subject ) : Phalcon\Mvc\Model\Resultset\Simple Create and get from a Resultset
get ( ) : null | Phalcon\Mvc\ModelInterface[] | Phalcon\Mvc\ModelInterface
getSubject ( ) : null | Phalcon\Mvc\ModelInterface[]
load ( ) Loader::execute() alias

Private Methods

Method Description
buildTree ( ) : Phalcon\Mvc\Model\EagerLoading\EagerLoad[] Resolves the relations
parseArguments ( array $arguments ) : array Parses the arguments that will be resolved to Relation instances

Method Details

__construct() public method

public __construct ( Phalcon\Mvc\ModelInterface | Phalcon\Mvc\ModelInterface[] | Phalcon\Mvc\Model\Resultset\Simple $from )
$from Phalcon\Mvc\ModelInterface | Phalcon\Mvc\ModelInterface[] | Phalcon\Mvc\Model\Resultset\Simple

addEagerLoad() public method

public addEagerLoad ( string $relationAlias, null | callable $constraints = null )
$relationAlias string
$constraints null | callable

execute() public method

public execute ( )

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

fromArray() public static method

Create and get from an array
public static fromArray ( array $subject ) : array
$subject array
return array

fromModel() public static method

Create and get from a Model
public static fromModel ( Phalcon\Mvc\ModelInterface $subject ) : Phalcon\Mvc\ModelInterface
$subject Phalcon\Mvc\ModelInterface
return Phalcon\Mvc\ModelInterface

fromResultset() public static method

Create and get from a Resultset
public static fromResultset ( Phalcon\Mvc\Model\Resultset\Simple $subject ) : Phalcon\Mvc\Model\Resultset\Simple
$subject Phalcon\Mvc\Model\Resultset\Simple
return Phalcon\Mvc\Model\Resultset\Simple

get() public method

public get ( ) : null | Phalcon\Mvc\ModelInterface[] | Phalcon\Mvc\ModelInterface
return null | Phalcon\Mvc\ModelInterface[] | Phalcon\Mvc\ModelInterface

getSubject() public method

public getSubject ( ) : null | Phalcon\Mvc\ModelInterface[]
return null | Phalcon\Mvc\ModelInterface[]

load() public method

Loader::execute() alias
public load ( )

Property Details

$eagerLoads protected property

protected array $eagerLoads
return array

$mustReturnAModel protected property

protected bool $mustReturnAModel
return boolean

$subject protected property

protected ModelInterface[],Phalcon\Mvc $subject
return Phalcon\Mvc\ModelInterface[]

$subjectClassName protected property

protected string $subjectClassName
return string