/**
  * @return string
  */
 public function getForeignDatabaseTableName()
 {
     if (is_object($this->foreignModel)) {
         return $this->foreignModel->getDatabaseTableName();
     } else {
         return $this->foreignDatabaseTableName;
     }
 }
 /**
  * Helper function to find the parents class recordType
  * @param Tx_ExtensionBuilder_Domain_Model_DomainObject $domainObject
  * @return string
  */
 public function render(Tx_ExtensionBuilder_Domain_Model_DomainObject $domainObject)
 {
     $classSettings = $this->configurationManager->getExtbaseClassConfiguration($domainObject->getParentClass());
     if (isset($classSettings['recordType'])) {
         $parentRecordType = $classSettings['recordType'];
     } else {
         $parentRecordType = str_replace('Domain_Model_', '', $domainObject->getParentClass());
         if (!isset($TCA[$domainObject->getDatabaseTableName()]['types'][$parentRecordType])) {
             $parentRecordType = 1;
         }
     }
     $this->templateVariableContainer->add('parentRecordType', $parentRecordType);
     $content = $this->renderChildren();
     $this->templateVariableContainer->remove('parentRecordType');
     return $content;
 }
Esempio n. 3
0
 /**
  * Returns the current TCA for a domain objects table if the extension is installed
  * TODO: check for previous table name if an extension is renamed
  *
  * @param Tx_ExtensionBuilder_Domain_Model_DomainObject $domainObject
  *
  * @return array
  */
 protected static function getTcaForDomainObject($domainObject, $extension)
 {
     $tableName = $domainObject->getDatabaseTableName();
     t3lib_div::loadTca($tableName);
     if (isset($GLOBALS['TCA'][$tableName])) {
         return $GLOBALS['TCA'][$tableName];
     } else {
         return NULL;
     }
 }