/** * {@inheritdoc} */ public function addObject(ObjectInterface $object) { $this->setOption($object->getType() . 's', $this->getOption($object->getType() . 's', array()) + array($object->getMachineName())); $object->setWeight(count($this->getOption($object->getType() . 's', array())) + 2); $this->getCollection()->import(array($object)); return $this; }
/** * Add object to this collection. * * @param ObjectInterface $object * Object instance to add to this collection. */ public function append(ObjectInterface $object) { $object->setWeight($object->getWeight() + count($this->objects)); $this->objects[$object->getType() . '_' . $object->getMachineName()] = $object; }