Entity Manager

Siteadmin uses Doctrine 2 as its internal ORM. All create/update/remove operations are handled through the doctrine entity manager context.
This is just a quick start guide to doctrine's entity manager. Visit the official documentation for detailed explanations.

Accessing Entity Manager Context

// Returns doctrine entity manager instance
$entityManager = \sa\application\app::$entityManager

Create/Update Entity

// Create entity instance
$user = ioc::resolve('User');
// Set fields
// Queue changes in entity manager
// Commit $user object specific changes
// Commit all persisted changes

Remove Entity

// $user is an entity which already exists in the entity manager.
Last modified 5yr ago