Mvc\Model::setDI

public setDI (Phalcon\DiInterface $dependencyInjector) Sets the dependency injection container

Mvc\Model::reset

public reset () Reset a model instance data

Mvc\Model::save

public boolean save ([array $data], [array $whiteList]) Inserts or updates a model instance. Returning true on success or false otherwise. //Creating a new robot $robot = new Robots(); $robot->type = 'mechanical'; $robot->name = 'Astro Boy'; $robot->year = 1952; $robot->save(); //Updating a robot name $robot = Robots::findFirst("id=100"); $robot->name = "Biomass"; $robot->save();

Mvc\Model::query

public static query ([Phalcon\DiInterface $dependencyInjector]) Create a criteria for a specific model

Mvc\Model::refresh

public refresh () Refreshes the model attributes re-querying the record from the database

Mvc\Model::serialize

public serialize () Serializes the object ignoring connections, services, related objects or static properties

Mvc\Model::readAttribute

public readAttribute (mixed $attribute) Reads an attribute value by its name echo $robot->readAttribute('name');

Mvc\Model::minimum

public static mixed minimum ([array $parameters]) Allows to get the minimum value of a column that match the specified conditions //What is the minimum robot id? $id = Robots::minimum(array('column' => 'id')); echo "The minimum robot id is: ", $id; //What is the minimum id of mechanical robots? $sum = Robots::minimum(array("type='mechanical'", 'column' => 'id')); echo "The minimum robot id of mechanical robots is ", $id;

Mvc\Model::OP_UPDATE

integer OP_UPDATE

Mvc\Model::OP_NONE

integer OP_NONE