Mvc\Model::fireEventCancel

public fireEventCancel (mixed $eventName) Fires an event, implicitly calls behaviors and listeners in the events manager are notified This method stops if one of the callbacks/listeners returns boolean false

Mvc\Model::getDirtyState

public getDirtyState () Returns one of the DIRTY_STATE_* constants telling if the record exists in the database or not

Mvc\Model::getDI

public getDI () Returns the dependency injection container

Mvc\Model::dump

public dump () Returns a simple representation of the object that can be used with var_dump var_dump($robot->dump());

Mvc\Model::find

public static find ([mixed $parameters]) Allows to query a set of records that match the specified conditions // How many robots are there? $robots = Robots::find(); echo 'There are ', count($robots), "\n"; // How many mechanical robots are there? $robots = Robots::find("type='mechanical'"); echo 'There are ', count($robots), "\n"; // Get and print virtual robots ordered by name $robots = Robots::find(["type='virtual'", 'order' => 'name']); foreach ($robots as $robot) { echo $robo

Mvc\Model::DIRTY_STATE_PERSISTENT

integer DIRTY_STATE_PERSISTENT

Mvc\Model::DIRTY_STATE_TRANSIENT

integer DIRTY_STATE_TRANSIENT

Mvc\Model::findFirst

public static static findFirst ([string | array $parameters]) Allows to query the first record that match the specified conditions //What's the first robot in robots table? $robot = Robots::findFirst(); echo "The robot name is ", $robot->name; //What's the first mechanical robot in robots table? $robot = Robots::findFirst("type='mechanical'"); echo "The first mechanical robot name is ", $robot->name; //Get first virtual robot ordered by name $robot = Robots::findFirst(array("type

Mvc\Model::DIRTY_STATE_DETACHED

integer DIRTY_STATE_DETACHED

Mvc\Model::create

public create ([mixed $data], [mixed $whiteList]) Inserts a model instance. If the instance already exists in the persistence it will throw an exception 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->create(); //Passing an array to create $robot = new Robots(); $robot->create(array( 'type' => 'mechanical', 'name' => 'Astro Boy', 'ye