1: <?php
2:
3: namespace PHPixie\ORM\Wrappers\Model;
4:
5: abstract class Entity implements \PHPixie\ORM\Models\Model\Entity
6: {
7: 8: 9:
10: protected $entity;
11:
12: public function __construct($entity)
13: {
14: $this->entity = $entity;
15: }
16:
17: public function modelName()
18: {
19: return $this->entity->modelName();
20: }
21:
22: public function asObject($recursive = false)
23: {
24: return $this->entity->asObject($recursive);
25: }
26:
27: public function getRelationshipProperty($relationship, $createMissing = true)
28: {
29: return $this->entity->getRelationshipProperty($relationship, $createMissing);
30: }
31:
32: public function data()
33: {
34: return $this->entity->data();
35: }
36:
37: public function getField($name, $default = null)
38: {
39: return $this->entity->getField($name, $default);
40: }
41:
42: public function getRequiredField($name)
43: {
44: return $this->entity->getRequiredField($name);
45: }
46:
47: public function setField($key, $value)
48: {
49: $this->entity->setField($key, $value);
50: return $this;
51: }
52:
53: public function __get($name)
54: {
55: return $this->entity->__get($name);
56: }
57:
58: public function __set($name, $value)
59: {
60: $this->entity->__set($name, $value);
61: }
62:
63: public function __call($method, $params)
64: {
65: return $this->entity->__call($method, $params);
66: }
67: }