Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Extend blog_example with relations
* 1:1 inline relation csv (Post->additonalName) * 1:1 inline relation foreign_field (Post->additonalInfo) * 1:n inline relation csv (Post->additionalComments) * n:1 group relation (Post->secondAuthor) It also makes Person model translatable. Resolves: #85974 Releases: master Change-Id: I75a8e6c070e9a6bdfba0772b102a13bc94f7556f Reviewed-on: https://review.typo3.org/58032 Tested-by: TYPO3com <no-reply@typo3.com> Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com> Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com> Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de> Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
- Loading branch information
Showing
7 changed files
with
377 additions
and
5 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
...t/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/Domain/Model/Info.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
namespace ExtbaseTeam\BlogExample\Domain\Model; | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
/** | ||
* A post additional info (1:1 inline relation to post) | ||
*/ | ||
class Info extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity | ||
{ | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $name = ''; | ||
|
||
/** | ||
* Sets the name | ||
* | ||
* @param string $name | ||
*/ | ||
public function setName($name) | ||
{ | ||
$this->content = $name; | ||
} | ||
|
||
/** | ||
* Getter for name | ||
* | ||
* @return string | ||
*/ | ||
public function getName() | ||
{ | ||
return $this->name; | ||
} | ||
|
||
/** | ||
* Returns this info as a formatted string | ||
* | ||
* @return string | ||
*/ | ||
public function __toString() | ||
{ | ||
return $this->name; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
...l/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_info.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<?php | ||
|
||
return [ | ||
'ctrl' => [ | ||
'title' => 'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xml:tx_blogexample_domain_model_info', | ||
'label' => 'name', | ||
'tstamp' => 'tstamp', | ||
'crdate' => 'crdate', | ||
'versioningWS' => true, | ||
'languageField' => 'sys_language_uid', | ||
'transOrigPointerField' => 'l18n_parent', | ||
'transOrigDiffSourceField' => 'l18n_diffsource', | ||
'delete' => 'deleted', | ||
'sortby' => 'sorting', | ||
'enablecolumns' => [ | ||
'disabled' => 'hidden' | ||
], | ||
'iconfile' => 'EXT:blog_example/Resources/Public/Icons/icon_tx_blogexample_domain_model_tag.gif' | ||
], | ||
'interface' => [ | ||
'showRecordFieldList' => 'hidden, name' | ||
], | ||
'columns' => [ | ||
'sys_language_uid' => [ | ||
'exclude' => true, | ||
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.language', | ||
'config' => [ | ||
'type' => 'select', | ||
'renderType' => 'selectSingle', | ||
'special' => 'languages', | ||
'items' => [ | ||
[ | ||
'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.allLanguages', | ||
-1, | ||
'flags-multiple' | ||
], | ||
], | ||
'default' => 0, | ||
] | ||
], | ||
'l18n_parent' => [ | ||
'exclude' => true, | ||
'displayCond' => 'FIELD:sys_language_uid:>:0', | ||
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.l18n_parent', | ||
'config' => [ | ||
'type' => 'select', | ||
'renderType' => 'selectSingle', | ||
'items' => [ | ||
['', 0], | ||
], | ||
'foreign_table' => 'tx_blogexample_domain_model_info', | ||
'foreign_table_where' => 'AND tx_blogexample_domain_model_info.pid=###CURRENT_PID### AND tx_blogexample_domain_model_info.sys_language_uid IN (-1,0)', | ||
'default' => 0 | ||
] | ||
], | ||
'l18n_diffsource' => [ | ||
'config' => [ | ||
'type' => 'passthrough', | ||
'default' => '', | ||
], | ||
], | ||
'hidden' => [ | ||
'exclude' => true, | ||
'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.visible', | ||
'config' => [ | ||
'type' => 'check', | ||
'renderType' => 'checkboxToggle', | ||
'items' => [ | ||
[ | ||
0 => '', | ||
1 => '', | ||
'invertStateDisplay' => true | ||
] | ||
], | ||
] | ||
], | ||
'name' => [ | ||
'label' => 'LLL:EXT:blog_example/Resources/Private/Language/locallang_db.xml:tx_blogexample_domain_model_info.name', | ||
'config' => [ | ||
'type' => 'input', | ||
'size' => 20, | ||
'eval' => 'trim, required', | ||
'max' => 256 | ||
] | ||
], | ||
'post' => [ | ||
'config' => [ | ||
'type' => 'passthrough', | ||
] | ||
], | ||
], | ||
'types' => [ | ||
0 => ['showitem' => 'sys_language_uid, l18n_parent, hidden, name'] | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.