Skip to content

Instantly share code, notes, and snippets.

View tlode's full-sized avatar

Tobias Lode tlode

View GitHub Profile
@tlode
tlode / gist:c2f0635c03f2650d1eb3
Last active August 29, 2015 14:13
CustomFlexibleEntity
<?php
namespace SimpleEntities;
use PommProject\ModelManager\Model\FlexibleEntity\FlexibleEntity;
use PommProject\ModelManager\Model\FlexibleEntity\FlexibleContainer;
use PommProject\ModelManager\Model\FlexibleEntity\StatefullEntityTrait;
class CustomFlexibleEntity extends FlexibleContainer
{
use StatefullEntityTrait;
/**
* begin transaction
*/
public function begin()
{
if(count($this->transactionStack) == 0)
{
$this->transactionStack[0] = true;
parent::beginTransaction();
}
@tlode
tlode / gist:6f1fa559d67c8461ba42
Last active August 29, 2015 14:13
TransactionTrait
<?php
namespace Model;
use PommProject\Foundation\Session\Connection;
use PommProject\ModelManager\Exception\ModelException;
use PommProject\ModelManager\ModelLayer\ModelLayer;
trait BbTransactionTrait
{
private $savePointStack = [];