I needed a new field "json" for my extension, so I've added the new field "json" (mediumtext) to the database, then I've added the following code to my Model:
/**
* json
*
* @var string
*/
protected $json = '';
/**
* Returns the json
*
* @return string $json
*/
public function getJson()
{
return $this->json;
}
/**
* Sets the json
*
* @param string $json
* @return void
*/
public function setJson($json)
{
$this->json = $json;
}
But when I set the property with $myObject->setJson("12345678910") and add the object to the repository and persist it
$this->myObjectRepository->add($myObject);
$this->persistenceManager->persistAll();
All other properties saved, except the json property (setter is called).
I also tried to map the property to the database field in typoscript:
plugin.tx_menopur {
persistence {
classes {
Company\Extension\Domain\Model\MyModel {
mapping {
tableName = tx_extension_domain_model_mymodel
recordType = \Company\Extension\Domain\Model\MyModel
columns {
json.mapOnProperty = json
}
}
}
}
}
}