<?php

/**
 * Created by PhpStorm.
 * User: emilychen
 * Date: 25/10/2015
 * Time: 10:50 AM
 */
require_once 'autoload.php';
use DataAccess\Persistence\AreaPersistenceFactory;
$area1 = new \DataAccess\Entity\Area();
$area1->setName('Holiday');
$area1->setSittingTime('18:00:00');
$area2 = new \DataAccess\Entity\Area();
$area2->setId(1);
$area2->setName('Sunny');
$area2->setSittingTime('19:00:00');
$areaPersistenceFactory = new AreaPersistenceFactory();
print_r($areaPersistenceFactory->getUpdateFactory()->newUpdate($area1));
echo '<br>';
print_r($areaPersistenceFactory->getUpdateFactory()->newUpdate($area2));
<?php

/**
 * Created by PhpStorm.
 * User: emilychen
 * Date: 25/10/2015
 * Time: 11:12 AM
 */
require_once 'autoload.php';
use DataAccess\Persistence\AreaPersistenceFactory;
use DataAccess\Persistence\IdentityObject\AreaIdentityObject;
$areaIdentity = new AreaIdentityObject();
$areaIdentity->field('name')->eq("Sunny")->field('sitting_time')->gt('17:00:00')->lt('21:00:00');
$areaPersistenceFactory = new AreaPersistenceFactory();
print_r($areaPersistenceFactory->getSelectionFactory()->newSelection($areaIdentity));