map test
[m6w6/pq-gateway] / lib / pq / Mapper / Map.php
index 58e1e5d5aa07c2f18208c59f066167e13dcb447f..bf577be38ca1fbce825fa9eab272a1f68829fde8 100644 (file)
@@ -28,7 +28,7 @@ class Map implements MapInterface
        /**
         * @var PropertyInterface[]
         */
-       private $properties;
+       private $properties = [];
 
        /**
         * Create a new object map definition
@@ -39,9 +39,8 @@ class Map implements MapInterface
        function __construct($class, Table $gateway, PropertyInterface ...$properties) {
                $this->class = $class;
                $this->gateway = $gateway;
-               $this->properties = $properties;
                foreach ($properties as $property) {
-                       $property->setContainer($this);
+                       $this->addProperty($property);
                }
                $this->objects = new ObjectManager($this);
        }