Ejemplo n.º 1
0
 public function test_getters_and_setters()
 {
     $entity = new ExampleEntity();
     $entity->setId(2);
     $entity->setName("test name");
     $entity->setNullable("not null");
     $entity->setNumeral(3);
     $entity->setCreated("2012-12-12 12:12:12");
     $entity->setUpdated("2012-12-13 13:13:13");
     $this->assertEqual($entity->getId(), 2);
     $this->assertEqual($entity->getName(), "test name");
     $this->assertEqual($entity->getNullable(), "not null");
     $this->assertEqual($entity->getNumeral(), 3);
     $this->assertEqual($entity->getCreated(), "2012-12-12 12:12:12");
     $this->assertEqual($entity->getUpdated(), "2012-12-13 13:13:13");
 }
Ejemplo n.º 2
0
 /**
  * @param ExampleEntity $object
  *
  * @return array
  */
 protected function mapEntityToArray($object)
 {
     /** @var ExampleEntity $object */
     $result = ['id' => $object->getId(), 'name' => $object->getName(), 'nullable' => $object->getNullable(), 'numeral' => $object->getNumeral(), 'created' => $object->getCreated(), 'updated' => $object->getUpdated()];
     return $result;
 }