src/Container/Model/Struct.php
public function add($object)
    {
        $inheritance = $object->getInheritance();
        if (!empty($inheritance)) {
            $this->virtualObjects[$this->getObjectKeyWithVirtual($object)] = $this->objects[$this->getObjectKeyWithType($object, $object->getInheritance())] = $object;
        } else {
            parent::add($object);
        }
        return $this;
    }
public function add($object)
    {
        $inheritance = $object->getInheritance();
        if (!empty($inheritance)) {
            $this->virtualObjects[$this->getObjectKeyWithVirtual($object)] = $this->objects[$this->getObjectKeyWithType($object, $object->getInheritance())] = $object;
        } else {
            parent::add($object);
        }
        return $this;
    }
public function add ( $ object ) { $ inheritance = $ object -> getInheritance ( ) ; if ( ! empty ( $ inheritance ) ) { $ this -> virtualObjects [ $ this -> getObjectKeyWithVirtual ( $ object ) ] = $ this -> objects [ $ this -> getObjectKeyWithType ( $ object , $ object -> getInheritance ( ) ) ] = $ object ; } else { parent :: add ( $ object ) ; } return $ this ; }
By overriding this method, we ensure that each time a new object is stored, it is stored with our new key if the inheritance is defined.
@param Model $object
@return Struct
By overriding this method we ensure that each time a new object is stored it is stored with our new key if the inheritance is defined .