Commit 0c90209e authored by Thomas Löffler's avatar Thomas Löffler

Extend TCA and model for composer_info field

parent dce467e0
......@@ -272,6 +272,11 @@ class Version extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
*/
protected $zipFileSize = 0;
/**
* @var string
*/
protected $composerInfo = '';
/**
* Constructor. Initializes all ObjectStorage instances.
*/
......@@ -1133,8 +1138,41 @@ class Version extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
return $this->zipFileSize;
}
/**
* @return string
*/
public function getComposerInfo()
{
return $this->composerInfo;
}
/**
* @param string $composerInfo
* @return void
*/
public function setComposerInfo(string $composerInfo)
{
$this->composerInfo = $composerInfo;
}
/** Helper functions */
/**
* @return string
*/
public function getComposerName()
{
$composerName = '';
if ($this->composerInfo !== '') {
$composerInfoAsArray = json_decode($this->composerInfo, true);
if (!empty($composerInfoAsArray)) {
$composerName = $composerInfoAsArray['name'];
}
}
return $composerName;
}
/**
* @return \T3o\TerFe2\Domain\Model\Relation
*/
......
......@@ -21,10 +21,10 @@ return array(
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('ter_fe2') . 'Resources/Public/Icons/version.gif',
),
'interface' => array(
'showRecordFieldList' => 'title,description,version_number,version_string,upload_date,upload_comment,download_counter,frontend_download_counter,state,em_category,load_order,priority,shy,internal,do_not_load_in_fe,uploadfolder,clear_cache_on_load,module,create_dirs,modify_tables,lock_type,cgl_compliance,cgl_compliance_note,review_state,manual,has_manual,software_relations,author,file_hash,extension_provider,has_zip_file,has_images',
'showRecordFieldList' => 'title,description,version_number,version_string,upload_date,upload_comment,download_counter,frontend_download_counter,state,em_category,load_order,priority,shy,internal,do_not_load_in_fe,uploadfolder,clear_cache_on_load,module,create_dirs,modify_tables,lock_type,cgl_compliance,cgl_compliance_note,review_state,manual,has_manual,software_relations,author,file_hash,extension_provider,has_zip_file,has_images,composer_info',
),
'types' => array(
'1' => array('showitem' => 'title,description,version_number,version_string,upload_date,upload_comment,download_counter,frontend_download_counter,state,em_category,load_order,priority,shy,internal,do_not_load_in_fe,uploadfolder,clear_cache_on_load,module,create_dirs,modify_tables,lock_type,cgl_compliance,cgl_compliance_note,review_state,manual,has_manual,software_relations,author,file_hash,extension_provider,has_zip_file,has_images'),
'1' => array('showitem' => 'title,description,version_number,version_string,upload_date,upload_comment,download_counter,frontend_download_counter,state,em_category,load_order,priority,shy,internal,do_not_load_in_fe,uploadfolder,clear_cache_on_load,module,create_dirs,modify_tables,lock_type,cgl_compliance,cgl_compliance_note,review_state,manual,has_manual,software_relations,author,file_hash,extension_provider,has_zip_file,has_images,composer_info'),
),
'palettes' => array(
'1' => array('showitem' => ''),
......@@ -404,5 +404,14 @@ return array(
'type' => 'passthrough',
),
),
'composer_info' => array(
'exclude' => 0,
'label' => 'Composer Info (JSON)',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
),
);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment