$this->checkForAlreadyPersistedValueObject($object);
}
-
+ // Fill up $row[$columnName] array with changed values which need to be stored
foreach ($properties as $propertyName => $propertyValue) {
if ($dataMap->isPersistableProperty($propertyName) && ($propertyValue instanceof Tx_Extbase_Persistence_LazyLoadingProxy)) {
continue;
}
} elseif ($propertyValue instanceof Tx_Extbase_DomainObject_DomainObjectInterface) {
// TODO Handle Value Objects different
+ // SK: this is the case RELATION_HAS_ONE, correct?
if ($propertyValue->_isNew()) {
+ // SK: What happens if the value is not new, but changed?
$this->persistObject($propertyValue);
}
$row[$columnName] = $propertyValue->getUid();
}
} else {
+ // Not an relation, this means it is a simple type such as STRING or Integer
+ // SK: I think that the second option $fullQuoteString is NOT needed here, as this should be the job of the persistence backend.
$row[$columnName] = $dataMap->convertPropertyValueToFieldValue($properties[$propertyName], FALSE);
}
}
} elseif ($object->_isDirty()) {
$this->updateObject($object, $parentObject, $parentPropertyName, $row);
}
-
+
+ // SK: I need to check the code below more thoroughly
if ($parentObject instanceof Tx_Extbase_DomainObject_DomainObjectInterface && !empty($parentPropertyName)) {
$parentClassName = get_class($parentObject);
$parentDataMap = $this->dataMapper->getDataMap($parentClassName);
if ($object instanceof Tx_Extbase_DomainObject_AbstractEntity) {
$object->_memorizeCleanState();
}
-
+
+ // SK: Where does $queue come from? Do we need the code below?
if ($processQueue === TRUE) {
foreach ($queue as $queuedObjects) {
foreach($queuedObjects as $propertyName => $queuedObject) {
* @param array $relations The queued relations
* @return void
*/
+ // SK: The below method is never called.
+ // SK: I think there is still a problem with deleted objects and deleted relations.
+ // SK: I am not yet sure where deleted relations ae handled. Need to check more thoroughly!
protected function deleteRelatedObjects(Tx_Extbase_DomainObject_DomainObjectInterface $object, array $relations) {
$dataMap = $this->dataMapper->getDataMap(get_class($object));
foreach ($relations as $propertyName => $relatedObjects) {
* @subpackage extbase
* @version $ID:$
*/
+// SK: Is this interface used anywhere? I guess not.
interface Tx_Extbase_Persistence_DataMapperInterface {
/**
$this->setPropertyType($columnMap, $columnConfiguration);
// TODO support for IRRE
// TODO support for MM_insert_fields and MM_match_fields
- // SK: Discuss the above things
+ // SK: are the above TODOs still valid?
$this->setRelations($columnMap, $columnConfiguration);
$this->addColumnMap($columnMap);
}
break;
// FIXME we have an object to handle... -> exception
default:
+ // SK: We should throw an exception as this point as there was an undefined propertyType we can not handle.
if (isset($row[$propertyName])) {
$property = $row[$propertyName];
if (is_object($property)) {
$propertyValue = $this->mapObject($property);
+ // SK: THIS case can not happen I think. At least $this->mapObject() is not available.
} else {
+ // SK: This case does not make sense either. $this-mapSingleRow has a different signature
$propertyValue = $this->mapSingleRow($className, $property);
}
}
* @version $Id: PreparedQuery.php 2120 2009-04-02 10:06:31Z k-fish $
* @scope prototype
*/
+// SK: I think this can be removed for now.
class Tx_Extbase_Persistence_PreparedQuery extends Tx_Extbase_Persistence_Query implements Tx_Extbase_Persistence_PreparedQueryInterface {
/**
* @subpackage Persistence
* @version $Id: PreparedQueryInterface.php 1811 2009-01-28 12:04:49Z robert $
*/
+// SK: I think this can be removed for now.
interface Tx_Extbase_Persistence_PreparedQueryInterface extends Tx_Extbase_Persistence_QueryInterface {
/**
/**
* A NAME is a pairing of a namespace and a local name. When read, the
* namespace is mapped to the current prefix.
+ *
+ * WE DO NOT USE THIS IN EXTBASE!
*/
const NAME = 7;
* A PATH property is an ordered list of path elements. A path element is a
* NAME with an optional index. When read, the NAMEs within the path are
* mapped to their current prefix. A path may be absolute or relative.
+ *
+ * WE DO NOT USE THIS IN EXTBASE!
*/
const PATH = 8;
* A WEAKREFERENCE property stores the identifier of a referenceable node
* (one having type mix:referenceable). A WEAKREFERENCE property does not
* enforce referential integrity.
+ *
+ * WE DO NOT USE THIS IN EXTBASE!
*/
const WEAKREFERENCE = 10;
* A URI property is identical to STRING property except that it only
* accepts values that conform to the syntax of a URI-reference as defined
* in RFC 3986.
+ *
+ * WE DO NOT USE THIS IN EXTBASE!
*/
const URI = 11;
/**
* The DECIMAL property type is used to store precise decimal numbers.
+ *
+ * WE DO NOT USE THIS IN EXTBASE!
*/
const DECIMAL = 12;
/**
* The INTEGER property type is used to store precise decimal numbers.
+ *
+ * WE DO NOT USE THIS IN EXTBASE!
*/
const INTEGER = 13;
$object = NULL;
if (count($result) > 0) {
$object = current($result);
+ // SK: registerReconstitutedObject() needs to be called automatically inside the DataMapper!
$this->persistenceManager->getSession()->registerReconstitutedObject($object);
}
return $object;
* @return void
*/
public function commit() {
+ // SK: This is old code, which needs to be removed.
$aggregateRootObjects = new Tx_Extbase_Persistence_ObjectStorage();
$aggregateRootObjects->addAll($this->getAddedObjects());
$aggregateRootObjects->addAll($this->getReconstitutedObjects());