/** * @param bool $download_as_file * @return string */ public function exportAsSerializedData($download_as_file = false) { if (!$this->getCollectedObjects()) { $this->collectObjects(false, true); } $objects = []; $object = NULL; foreach ($this->getCollectedObjects() as $object) { /** @var Entity $object */ $objects[] = $object; } if (!$objects) { error('No Objects selected'); } $data = []; $data['objects'] = serialize($objects); $data['class'] = Converter::getPathToClassFile($object); $data['class'] = str_replace(DIR_BASE, '', $data['class']); $data = serialize($data); if (!$download_as_file) { return $data; } FileSystem::streamOutput(Converter::classWithNamespaceToUnqualifiedShort($object) . '.cms_obj', $data); return $data; }
private function getRealEntityName($entity = NULL) { if (!$entity) { $entity = $this->getRealEntityInUse(); } return Converter::classWithNamespaceToUnqualifiedShort($entity); }