/** * @param LoggableAdapter $ea * @param Log $logEntry * @param $object * @param $message * @return LogParent */ protected function addLogParent(LoggableAdapter $ea, Log $logEntry, $object, $message, $childObject, $fieldName) { $om = $ea->getObjectManager(); $parentLogEntry = new LogParent(); $parentLogEntry->setAction($message); $parentLogEntry->setUsername($this->username); $parentLogEntry->setSourceUsername($this->sourceUsername); $wrappedParent = AbstractWrapper::wrap($object, $om); $parentLogEntry->setObjectClass($wrappedParent->getMetadata()->name); $parentLogEntry->setObjectId($wrappedParent->getIdentifier()); $parentLogEntry->setFieldName($fieldName); $logEntry->addParent($parentLogEntry); $this->pendingParents[spl_object_hash($object)][] = array('log' => $parentLogEntry, 'field' => 'objectId'); $this->pendingParents[spl_object_hash($childObject)][] = array('log' => $parentLogEntry, 'field' => 'childId'); return $parentLogEntry; }