在我的扩展中MyExt,我将模型映射Page到pagesTYPO3中的表.首先它向我显示type mismatch错误,我无论如何都继续保存它.
发生以下事情:



在我,MyExt/Configuration/TypoScript/setup.txt我有这个:
config.tx_extbase.persistence.classes {
Tx_MyExt_Domain_Model_Page {
mapping {
tableName = pages
}
}
}
Run Code Online (Sandbox Code Playgroud)
这是一个错误吗?或者我做错了什么?
这是我的/Domain/Model/Page.php,只是一瞥.
class Page extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
{
/**
* uid
* @var int
* @validate NotEmpty
*/
protected $uid;
/**
* title
* @var string
* @validate NotEmpty
*/
protected $title;
/**
* __construct
*
* @return Page
*/
public function __construct() {
//Do not remove the next line: It would break the functionality
$this->initStorageObjects();
}
/**
* Returns the title
*
* @return string $title
*/
public function getTitle(){
return $this->title;
}
}
Run Code Online (Sandbox Code Playgroud)
我的/Domain/Repository/PageRepository.php是
class PageRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
}
Run Code Online (Sandbox Code Playgroud)
$TCA['pages']只需从文件中删除整个部分my_ext/ext_tables.php,或将其注释掉。
如果设置,它将使用扩展中的值覆盖 TYPO3 核心中的大多数默认 TCA 设置。您可能不需要为此进行自定义设置。