Project Versions

Table Of Contents

Previous topic

Interface Phalcon\Mvc\Model\CriteriaInterface

Next topic

Interface Phalcon\Mvc\Model\MessageInterface

This Page

Interface Phalcon\Mvc\Model\ManagerInterface

Phalcon\Mvc\Model\ManagerInterface initializer

Methods

abstract public initialize (Phalcon\Mvc\ModelInterface $model)

Initializes a model in the model manager

abstract public boolean isInitialized (string $modelName)

Check of a model is already initialized

abstract public Phalcon\Mvc\ModelInterface getLastInitialized ()

Get last initialized model

abstract public Phalcon\Mvc\ModelInterface load (unknown $modelName)

Loads a model throwing an exception if it doesn’t exist

abstract public addHasOne (Phalcon\Mvc\ModelInterface $model, mixed $fields, string $referenceModel, mixed $referencedFields, array $options)

Setup a 1-1 relation between two models

abstract public addBelongsTo (Phalcon\Mvc\ModelInterface $model, mixed $fields, string $referenceModel, mixed $referencedFields, array $options)

Setup a relation reverse 1-1 between two models

abstract public addHasMany (Phalcon\Mvc\ModelInterface $model, mixed $fields, string $referenceModel, mixed $referencedFields, array $options)

Setup a relation 1-n between two models

abstract public boolean existsBelongsTo (string $modelName, string $modelRelation)

Checks whether a model has a belongsTo relation with another model

abstract public boolean existsHasMany (string $modelName, string $modelRelation)

Checks whether a model has a hasMany relation with another model

abstract public boolean existsHasOne (string $modelName, string $modelRelation)

Checks whether a model has a hasOne relation with another model

abstract public Phalcon\Mvc\Model\ResultsetInterface getBelongsToRecords (string $method, string $modelName, string $modelRelation, Phalcon\Mvc\Model $record, array $parameters)

Gets belongsTo related records from a model

abstract public Phalcon\Mvc\Model\ResultsetInterface getHasManyRecords (string $method, string $modelName, string $modelRelation, Phalcon\Mvc\Model $record, array $parameters)

Gets hasMany related records from a model

abstract public Phalcon\Mvc\Model\ResultsetInterface getHasOneRecords (string $method, string $modelName, string $modelRelation, Phalcon\Mvc\Model $record, array $parameters)

Gets belongsTo related records from a model

abstract public array getBelongsTo (Phalcon\Mvc\ModelInterface $model)

Gets belongsTo relations defined on a model

abstract public array getHasMany (Phalcon\Mvc\ModelInterface $model)

Gets hasMany relations defined on a model

abstract public array getHasOne (Phalcon\Mvc\ModelInterface $model)

Gets hasOne relations defined on a model

abstract public array getHasOneAndHasMany (Phalcon\Mvc\ModelInterface $model)

Gets hasOne relations defined on a model

abstract public array getRelations (string $first, string $second)

Query the relations between two models

abstract public Phalcon\Mvc\Model\QueryInterface createQuery (string $phql)

Creates a Phalcon\Mvc\Model\Query without execute it

abstract public Phalcon\Mvc\Model\QueryInterface executeQuery (string $phql, array $placeholders)

Creates a Phalcon\Mvc\Model\Query and execute it