private function _saveObject(PersistentObject $object, ClassMap $classMap, &$commands) { if ($classMap->getSuperClassMap() != NULL) { // if comentado pois não estava ocorrendo o update da classe Pai, só o insert. // if (is_null($object->getAttributeValue($classMap->getReferenceAttributeMap()))) { $isPersistent = $object->isPersistent(); $this->_saveObject($object, $classMap->getSuperClassMap(), $commands); $object->setPersistent($isPersistent); // } } $operation = $object->isPersistent() ? 'update' : 'insert'; if ($operation == 'update') { $statement = $classMap->getUpdateSqlFor($object); $commands[] = $statement->update(); } else { $classMap->setObjectKey($object); $statement = $classMap->getInsertSqlFor($object); $commands[] = $statement->insert(); } if ($cmd = $classMap->handleTypedAttribute($object, $operation)) { $commands[] = $cmd; } $this->logger($commands, $classMap, $object, $operation); $mmCmd = array(); $associationMaps = $classMap->getAssociationMaps(); foreach ($associationMaps as $associationMap) { if ($associationMap->isSaveAutomatic()) { $this->__saveAssociation($object, $associationMap, $mmCmd, $classMap); } } if (count($mmCmd)) { $commands = array_merge($commands, $mmCmd); } $object->setPersistent(true); }