Mvc\Collection::getMessages

public getMessages () Returns all the validation messages $robot = new Robots(); $robot->type = 'mechanical'; $robot->name = 'Astro Boy'; $robot->year = 1952; if ($robot->save() == false) { echo "Umh, We can't store robots right now "; foreach ($robot->getMessages() as message) { echo message; } } else { echo "Great, a new robot was saved successfully!"; }

Mvc\Collection::getId

public MongoId getId () Returns the value of the _id property

Mvc\Collection::getDI

public getDI () Returns the dependency injection container

Mvc\Collection::getConnectionService

public getConnectionService () Returns DependencyInjection connection service

Mvc\Collection::getConnection

public MongoDb getConnection () Retrieves a database connection

Mvc\Collection::getCollectionManager

public getCollectionManager () Returns the models manager related to the entity instance

Mvc\Collection::fireEventCancel

public fireEventCancel (mixed $eventName) Fires an internal event that cancels the operation

Mvc\Collection::fireEvent

public fireEvent (mixed $eventName) Fires an internal event

Mvc\Collection::findFirst

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

Mvc\Collection::findById

public static findById (mixed $id) Find a document by its id (_id) // Find user by using \MongoId object $user = Users::findById(new \MongoId('545eb081631d16153a293a66')); // Find user by using id as sting $user = Users::findById('45cbc4a0e4123f6920000002'); // Validate input if ($user = Users::findById($_POST['id'])) { // ... }