/** * Inserts an object in the storage backend * * @param \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object The object to be insterted in the storage * @return void */ protected function insertObject(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object) { $this->signalSlotDispatcher->dispatch('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Backend', 'beforeInsertObjectHijax', array('object' => $object)); parent::insertObject($object); if ($object->getUid() >= 1) { /* * Check if update operation will be called for this object * (depending on the properties) * @see \TYPO3\CMS\Extbase\Persistence\Generic\Backend::persistObject */ $dataMap = $this->dataMapper->getDataMap(get_class($object)); $properties = $object->_getProperties(); $row = array(); foreach ($properties as $propertyName => $propertyValue) { if (!$propertyValue || !is_object($propertyValue) || !$dataMap->isPersistableProperty($propertyName) || $this->propertyValueIsLazyLoaded($propertyValue)) { continue; } $columnMap = $dataMap->getColumnMap($propertyName); if ($propertyValue instanceof \TYPO3\CMS\Extbase\Persistence\ObjectStorage) { if ($object->_isNew() || $propertyValue->_isDirty()) { $row[$columnMap->getColumnName()] = true; } } elseif ($propertyValue instanceof \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface) { if ($object->_isDirty($propertyName)) { $row[$columnMap->getColumnName()] = true; } $queue[] = $propertyValue; } elseif ($object->_isNew() || $object->_isDirty($propertyName)) { $row[$columnMap->getColumnName()] = true; } } if (count($row) > 0) { $objectHash = spl_object_hash($object); $this->pendingInsertObjects[$objectHash] = $object; } else { $this->signalSlotDispatcher->dispatch('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Backend', 'afterInsertObjectHijax', array('object' => $object)); $this->_addedObjects->attach($object); } } }