TYPO3 Extbase fe_user UID in own model - typo3

I create a extbase Plugin in TYPO3 6.2. In one table i have a field "fuid" where i want to store the fe_users uid, to know which user can edit this record.
I set the "fuid" in createAction:
$newLocation->setFuID((int) $GLOBALS['TSFE']->fe_user->user['uid']);
This work. In the Database is the right UID.
But in the editAction:
$location->getFuID()
returns null
Why?
TCA:
fu_i_d' => array(
'exclude' => 1,
'label' => 'LLL:EXT:pitss24/Resources/Private/Language/locallang_db.xlf:tx_pitss24_domain_model_location.fu_i_d',
'config' => array(
'type' => 'select',
'items' => array (
array('',0),
),
'foreign_table' => 'fe_users',
'foreign_class' => '\TYPO3\CMS\Extbase\Domain\Model\FrontendUser',
'minitems' => 0,
'maxitems' => 1,
'size' => 10,
'appearance' => array(
'collapseAll' => 0,
'levelLinksPosition' => 'top',
'showSynchronizationLink' => 1,
'showPossibleLocalizationRecords' => 1,
'showAllLocalizationLink' => 1
),
),
),
In the Backend / TYPO3 is all OK!

In Model File.
/**
* feuseruid
*
* #var \TYPO3\CMS\Extbase\Domain\Model\FrontendUser
*/
protected $feuseruid;
// GET and SET Methods
/**
* Returns the feuseruid
*
* #return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser feuseruid
*/
public function getFeuseruid() {
return $this->feuseruid;
}
/*
* Sets the feuseruid
*
* #param string $feuseruid
* #return \TYPO3\CMS\Extbase\Domain\Model\FrontendUser feuseruid
*/
public function setFeuseruid(\TYPO3\CMS\Extbase\Domain\Model\FrontendUser $feuseruid) {
$this->feuseruid = $feuseruid;
}
In TCA File
'feuseruid' => array(
'exclude' => 1,
'label' => 'Feuser Id',
'config' => array(
'type' => 'inline',
'foreign_table' => 'fe_users',
'minitems' => 0,
'maxitems' => 1,
'appearance' => array(
'collapseAll' => 0,
'levelLinksPosition' => 'top',
'showSynchronizationLink' => 1,
'showPossibleLocalizationRecords' => 1,
'showAllLocalizationLink' => 1
),
),
),
In Sql.php
feuseruid int(11) unsigned DEFAULT '0' NOT NULL,
In Controller
/**
* User Repository
*
* #var \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository
* #inject
*/
protected $userRepository;
$userObject = $this->userRepository->findByUid($GLOBALS['TSFE']->fe_user->user['uid']);
$orders->setFeuseruid($userObject);
$this->yourRepository->add($orders);

i found the Error! The extensionBuilder writes wrong Data in the Model:
the right values are:
Model:
/*
*
* #var TYPO3\CMS\Extbase\Domain\Model\FrontendUser
*/
protected $fuID = NULL;
...
...
...
/**
* Returns the fuID
*
* #return TYPO3\CMS\Extbase\Domain\Model\FrontendUser fuID
*/
public function getFuID() {
return $this->fuID;
}
/*
* Sets the fuID
*
* #param string $fuID
* #return TYPO3\CMS\Extbase\Domain\Model\FrontendUser fuID
*/
public function setFuID(TYPO3\CMS\Extbase\Domain\Model\FrontendUser $fuID) {
$this->fuID = $fuID;
}
Controller:
/**
* User Repository
*
* #var \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository
* #inject
*/
protected $userRepository;
/**
* Den aktuell angemeldeten User auslesen
*
* #return \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository
*/
public function getCurrentUser() {
if ($this->currentUser == NULL && $GLOBALS['TSFE']->fe_user->user['uid'] > 0) {
$this->currentUser = $this->userRepository->findByUid($GLOBALS['TSFE']->fe_user->user['uid']);
}
return $this->currentUser;
}

Hard to say without the appropriate view of your model. It's very likely, that you have a mismatch between your model and your TCA: On the one hand you are using an integer (setFuID()), on the other hand you have an object (foreign_table/foreign_class). Maybe it's working after you have adjusted this to be the same.

Related

TYPO3 query equals by another table

I have TYPO3 7.6.18, and I have problem with query.
this works
public function getFiltered($offset = 0, $limit = 5){
$query = $this->createQuery();
$query->matching($query->equals('cruserId', 3));
return $query->execute();
But this not works
public function getFiltered($offset = 0, $limit = 5){
$query = $this->createQuery();
$query->matching($query->equals('cruserId.uid', 3));
return $query->execute();
this return empty. Why? I filter by condition in another table(fe_users). I need filter by uid, gender or other fields. I don't know where is a problem.
TCA:
'cruser_id' => [
'exclude' => 1,
'label' => 'LLL:EXT:fefiles/Resources/Private/Language/locallang_db.xlf:tx_fefiles_domain_model_photo.cruser_id',
'config' => [
'type' => 'inline',
'foreign_table' => 'fe_users',
'minitems' => 0,
'maxitems' => 1,
'appearance' => [
'collapseAll' => 0,
'levelLinksPosition' => 'top',
'showSynchronizationLink' => 1,
'showPossibleLocalizationRecords' => 1,
'showAllLocalizationLink' => 1
],
]
],
Model:
/**
* CruserId
*
* #var \Fhk\Feusersplus\Domain\Model\User
* #inject
*/
protected $cruserId;
/**
* Returns the cruserId
*
* #return \Fhk\Feusersplus\Domain\Model\User $cruserId
*/
public function getCruserId()
{
return $this->cruserId;
}
/**
* Sets the cruserId
*
* #return void
*/
public function setCruserId($cruserId)
{
$this->cruserId = $cruserId;
}
If I use cruserId.uid - it just return empty. I had specially create test ext by extension builder and make my model, tca the same, but it return empty. Help me please, good people) Do you now where is problem?
I think cruserId.uid is not your Tables fields. in TYPO3 Extabase query syntax you need to pass always feilds name like.
$query->equals($propertyName, $operand, $caseSensitive = true )
Parameters
string $propertyName The name of the property to compare against
mixed $operand The value to compare with
bool $caseSensitive Whether the equality test should be done
case-sensitive
For more infromation TYPO3 Query syntax
$query->getQuerySettings()->setRespectStoragePage(false);
$query->getQuerySettings()->setRespectSysLanguage(false);
this solved my problem

TCA property not working

I have in my TYPO3 an object called Location where I store informations about a city, including a pdf file.
In the backend I can upload a pdf without problem, but when I try to display it, I get NULL. The value of 'pdf' in the database is not NULL, but when I debug <f:debug>{location}</f:debug> I get pdf => NULL !!!
Here is my TCA/LOCATION :
$GLOBALS['TCA']['tx_locations_domain_model_location'] = array(
'ctrl' => $GLOBALS['TCA']['tx_locations_domain_model_location']['ctrl'],
....
'columns' => array(
...
'pdf' => array(
'exclude' => 1,
'label' => 'LLL:EXT:locations/Resources/Private/Language/locallang_db.xlf:tx_locations_domain_model_location.pdf',
'config' => array (
'type' => 'group',
'internal_type' => 'file',
'allowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
'uploadfolder' => 'uploads/pics',
'show_thumbs' => 1,
'size' => 1,
'minitems' => 0,
'maxitems' => 1
)
),
...
The Getter and Setter should be fine in typo3conf/ext/locations/Classes/Domain/Model/Location.php :
/**
* Returns the pdf
*
* #return \TYPO3\CMS\Extbase\Domain\Model\FileReference $pdf
*/
public function getPdf() {
return $this->pdf;
}
/**
* Sets the pdf
*
* #param \TYPO3\CMS\Extbase\Domain\Model\FileReference $pdf
* #return void
*/
public function setPdf(\TYPO3\CMS\Extbase\Domain\Model\FileReference $pdf) {
$this->pdf = $pdf;
}
You can see the debug gives pdf=> NULL from below:
My pdf column is not empty :
Did I miss something ??
UPDATE :
After the answer of Pavin, I can see something in PDF, but I can't get the name of the file in href tag , maybe I need to change something after the new answer.
I can see things changed in the Database, the pdf field now is boolean. that's why maybe I get pdf0.originalResource NULL, but in the backend I can upload files and see then after save and refresh !!!:
<p><f:translate key="tx_locations_domain_model_location.downloadpdf" /> <a class="download" target="_blank" title="Initiates file download" href="{location.pdf.originalResource.publicUrl}"><f:translate key="tx_locations_domain_model_location.here" />..</a></p>
UPDATE 2
my new Model/Location.php
/**
* pdf
*
* #var string
*/
protected $pdf = NULL;
...
/**
* Returns the pdf
*
* #return string $pdf
*/
public function getPdf() {
return $this->pdf;
}
/**
* Sets the pdf
*
* #param string $pdf
* #return void
*/
public function setPdf($pdf) {
$this->pdf = $pdf;
}
My TCA/Location.php
'pdf' => array(
'exclude' => 1,
'label' => 'LLL:EXT:locations/Resources/Private/Language/locallang_db.xlf:tx_locations_domain_model_location.pdf',
'config' => array (
'type' => 'group',
'internal_type' => 'file',
'allowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
'uploadfolder' => 'uploads/pics',
'show_thumbs' => 1,
'size' => 1,
'minitems' => 0,
'maxitems' => 1
)
),
You can use below TCA configuration for Doc types records. also add Getter and Setter methods in modle file.
'pdf' => array(
'exclude' => 0,
'label' => 'LLL:EXT:ext_key/Resources/Private/Language/locallang_db.xlf:label_key.files',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'pdf',
array('minitems' => 0,'maxitems' => 10),
'pdf,doc,docx'
),
),
For Model.php files.
/**
* pdf
*
*#var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference>
*/
protected $pdf;
initStorageObjects Methods :
protected function initStorageObjects() {
$this->files = new ObjectStorage();
parent::initializeObject();
}
Getter And Setter Method:
/**
* Returns the pdf
*
* #return ObjectStorage
*/
public function getPdf() {
return $this->pdf;
}
/**
* Sets the pdf
*
*/
public function setPdf($pdf) {
$this->pdf = $pdf;
}
See attached image for pdf name. Please add pdf title. For Pdf title you can use {location.pdf.title}
You use group as the type for saving the file in the TCA, so the property $pdf in your model must be string and not \TYPO3\CMS\Extbase\Domain\Model\FileReference
FileReference only work for FAL (File Abstraction Layer)

Validate File Extension IN Drupal 8 Entity Form

I have an Entity in Drupal 8 named visual_tracker_entity Here is my entity,
/**
* #file
* Contains \Drupal\visual_tracker\Entity\VisaulTrackerEntity.
*/
namespace Drupal\visual_tracker\Entity;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Field\BaseFieldDefinition;
use Drupal\Core\Entity\ContentEntityBase;
use Drupal\Core\Entity\EntityChangedTrait;
use Drupal\Core\Entity\EntityTypeInterface;
use Drupal\visual_tracker\VisaulTrackerEntityInterface;
use Drupal\user\UserInterface;
/**
* Defines the Visaul tracker entity entity.
*
* #ingroup visual_tracker
*
* #ContentEntityType(
* id = "visaul_tracker_entity",
* label = #Translation("Visaul tracker entity"),
* handlers = {
* "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",
* "list_builder" = "Drupal\visual_tracker\VisaulTrackerEntityListBuilder",
* "views_data" = "Drupal\visual_tracker\Entity\VisaulTrackerEntityViewsData",
*
* "form" = {
* "default" = "Drupal\visual_tracker\Form\VisaulTrackerEntityForm",
* "add" = "Drupal\visual_tracker\Form\VisaulTrackerEntityForm",
* "edit" = "Drupal\visual_tracker\Form\VisaulTrackerEntityForm",
* "delete" = "Drupal\visual_tracker\Form\VisaulTrackerEntityDeleteForm",
* },
* "access" = "Drupal\visual_tracker\VisaulTrackerEntityAccessControlHandler",
* "route_provider" = {
* "html" = "Drupal\visual_tracker\VisaulTrackerEntityHtmlRouteProvider",
* },
* },
* base_table = "visaul_tracker_entity",
* admin_permission = "administer visaul tracker entity entities",
* entity_keys = {
* "id" = "id",
* "address" = "address",
* "lat"="lat",
* "lng" = "lng"
* },
* links = {
* "canonical" = "/admin/structure/visaul_tracker_entity/{visaul_tracker_entity}",
* "add-form" = "/admin/structure/visaul_tracker_entity/add",
* "edit-form" = "/admin/structure/visaul_tracker_entity/{visaul_tracker_entity}/edit",
* "delete-form" = "/admin/structure/visaul_tracker_entity/{visaul_tracker_entity}/delete",
* "collection" = "/admin/structure/visaul_tracker_entity",
* },
* field_ui_base_route = "visaul_tracker_entity.settings"
* )
*/
class VisaulTrackerEntity extends ContentEntityBase implements VisaulTrackerEntityInterface {
use EntityChangedTrait;
/**
* {#inheritdoc}
*/
public static function preCreate(EntityStorageInterface $storage_controller, array &$values) {
parent::preCreate($storage_controller, $values);
$values += array(
'user_id' => \Drupal::currentUser()->id(),
);
}
/**
* {#inheritdoc}
*/
public function getName() {
return $this->get('name')->value;
}
/**
* {#inheritdoc}
*/
public function setName($name) {
$this->set('name', $name);
return $this;
}
/**
* {#inheritdoc}
*/
public function getAddress() {
return $this->get('address')->value;
}
/**
* {#inheritdoc}
*/
public function setAddress($address) {
$this->set('address', $address);
return $this;
}
/**
* {#inheritdoc}
*/
public function getLatittude() {
return $this->get('lat')->value;
}
/**
* {#inheritdoc}
*/
public function setLatitude($lat) {
$this->set('lat', $lat);
return $this;
}
/**
* {#inheritdoc}
*/
public function getLongitude() {
return $this->get('lng')->value;
}
/**
* {#inheritdoc}
*/
public function setLongitude($lng) {
$this->set('lng', $lng);
return $this;
}
/**
* {#inheritdoc}
*/
public function getCreatedTime() {
return $this->get('created')->value;
}
/**
* {#inheritdoc}
*/
public function setCreatedTime($timestamp) {
$this->set('created', $timestamp);
return $this;
}
/**
* {#inheritdoc}
*/
public function getOwner() {
return $this->get('user_id')->entity;
}
/**
* {#inheritdoc}
*/
public function getOwnerId() {
return $this->get('user_id')->target_id;
}
/**
* {#inheritdoc}
*/
public function setOwnerId($uid) {
$this->set('user_id', $uid);
return $this;
}
/**
* {#inheritdoc}
*/
public function setOwner(UserInterface $account) {
$this->set('user_id', $account->id());
return $this;
}
/**
* {#inheritdoc}
*/
public function isPublished() {
return (bool) $this->getEntityKey('status');
}
/**
* {#inheritdoc}
*/
public function setPublished($published) {
$this->set('status', $published ? NODE_PUBLISHED : NODE_NOT_PUBLISHED);
return $this;
}
/**
* {#inheritdoc}
*/
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
$fields['id'] = BaseFieldDefinition::create('integer')
->setLabel(t('ID'))
->setDescription(t('The ID of the Visaul tracker entity entity.'))
->setReadOnly(TRUE);
$fields['uuid'] = BaseFieldDefinition::create('uuid')
->setLabel(t('UUID'))
->setDescription(t('The UUID of the Visaul tracker entity entity.'))
->setReadOnly(TRUE);
$fields['user_id'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Authored by'))
->setDescription(t('The user ID of author of the Visaul tracker entity entity.'))
->setRevisionable(TRUE)
->setSetting('target_type', 'user')
->setSetting('handler', 'default')
->setDefaultValueCallback('Drupal\node\Entity\Node::getCurrentUserId')
->setTranslatable(TRUE)
->setDisplayOptions('view', array(
'label' => 'hidden',
'type' => 'author',
'weight' => 0,
))
->setDisplayOptions('form', array(
'type' => 'entity_reference_autocomplete',
'weight' => 5,
'settings' => array(
'match_operator' => 'CONTAINS',
'size' => '60',
'autocomplete_type' => 'tags',
'placeholder' => '',
),
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['my_new_file'] = BaseFieldDefinition::create('file')
->setLabel(t('My New File'))
->setDescription(t('The name of the Visaul tracker entity entity.'))
->setDefaultValue('')
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'file',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'file',
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['address'] = BaseFieldDefinition::create('string')
->setLabel(t('Address'))
->setDescription(t('The addres of the Visaul tracker entity entity.'))
->setSettings(array(
'max_length' => 250,
'text_processing' => 0,
))
->setDefaultValue('')
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'string_textfield',
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['lat'] = BaseFieldDefinition::create('string')
->setLabel(t('Latitiude'))
->setDescription(t('The latiitude of the Visaul tracker entity entity.'))
->setSettings(array(
'max_length' => 50,
'text_processing' => 0,
))
->setDefaultValue('')
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'string_textfield',
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['lng'] = BaseFieldDefinition::create('string')
->setLabel(t('Longitude'))
->setDescription(t('The name of the Visaul tracker entity entity.'))
->setSettings(array(
'max_length' => 50,
'text_processing' => 0,
))
->setDefaultValue('')
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'string',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'string_textfield',
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['status'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Publishing status'))
->setDescription(t('A boolean indicating whether the Visaul tracker entity is published.'))
->setDefaultValue(TRUE);
$fields['langcode'] = BaseFieldDefinition::create('language')
->setLabel(t('Language code'))
->setDescription(t('The language code for the Visaul tracker entity entity.'))
->setDisplayOptions('form', array(
'type' => 'language_select',
'weight' => 10,
))
->setDisplayConfigurable('form', TRUE);
$fields['created'] = BaseFieldDefinition::create('created')
->setLabel(t('Created'))
->setDescription(t('The time that the entity was created.'));
$fields['changed'] = BaseFieldDefinition::create('changed')
->setLabel(t('Changed'))
->setDescription(t('The time that the entity was last edited.'));
return $fields;
}
}
I need add validation rule for file type field. The default file type is come with .txt extension. I want to only allow .xls and .xlsx .
This is the file filed,
$fields['my_new_file'] = BaseFieldDefinition::create('file')
->setLabel(t('My New File'))
->setDescription(t('The name of the Visaul tracker entity entity.'))
->setDefaultValue('')
->setDisplayOptions('view', array(
'label' => 'above',
'type' => 'file',
'weight' => -4,
))
->setDisplayOptions('form', array(
'type' => 'file',
'weight' => -4,
))
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
Please help me.
I got the answer after digging drupal 8 core APIs.
If we're using a file field, then we can set the "file_extensions" setting. You can find out more information about a "file" type by going to the FileItem API.
$fields['my_new_file'] = BaseFieldDefinition::create('file')
->setSetting('file_extensions', 'xls xlsx');

TYPO3 Extbase 1:n relation objects not exposed in view

I'm currently learning extbase and fluid. I read along this SO post TYPO3 extbase & IRRE: add existing records with 'foreign_selector' to set up a relation in my extension. I got roles and people. N people can have M roles. Now everything works fine in the backend. While in the frontend I don't see the objects when I use f:debug. My problem is that the relation isn't correctly resolved by extbase (I think?).
This is my relation class:
<?php
namespace Vendor\People\Domain\Model;
/**
* Class PersonRoleRelation
* #scope prototype
* #entity
* #package Vendor\People\Domain\Model
*/
class PersonRelation extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
/**
* #var \Vendor\People\Domain\Model\Person
*/
protected $person;
/**
* #var \Vendor\People\Domain\Model\Role
*/
protected $role;
/**
* #param \Vendor\People\Domain\Model\Person $person
*/
public function setPerson($person) {
$this->person = $person;
}
/**
* #return \Vendor\People\Domain\Model\Person
*/
public function getPerson() {
return $this->person;
}
/**
* #param \Vendor\People\Domain\Model\Role $role
*/
public function setRole($role) {
$this->role = $role;
}
/**
* #return \Vendor\People\Domain\Model\Role
*/
public function getRole() {
return $this->role;
}
}
This is entity person:
<?php
namespace Vendor\People\Domain\Model;
/**
* Class Person
* #scope prototype
* #entity
* #package Vendor\People\Domain\Model
*/
class Person extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
public function __construct() {
$this->initStorageObjects();
}
/**
* #return void
*/
protected function initStorageObjects() {
$this->roles = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
}
/**
* Roles
* #var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Vendor\People\Domain\Model\PersonRelation>
*/
protected $roles = NULL;
/**
* the person's first name
* #var string
* #validate StringLength(minimum = 3, maximum = 50)
*/
protected $firstname;
/**
* the person's last name
* #var string
* #validate StringLength(minimum = 3, maximum = 50)
*/
protected $lastname;
/**
* the person's responsibilities within the company
* #var string
*/
protected $role;
/**
* Photo
* #var \TYPO3\CMS\Extbase\Domain\Model\FileReference
*/
protected $photo;
/**
* detail text about the person
* #var string
* #dontvalidate
*/
protected $description;
/**
* #param string $firstname
* #return void
*/
public function setFirstname($firstname) {
$this->firstname = $firstname;
}
/**
* #return string
*/
public function getFirstname() {
return $this->firstname;
}
/**
* #param string $lastname
* #return void
*/
public function setLastname($lastname) {
$this->lastname = $lastname;
}
/**
* #return string
*/
public function getLastname() {
return $this->lastname;
}
/**
* #param string $role
* #return void
*/
public function setRole($role) {
$this->role = $role;
}
/**
* #return string
*/
public function getRole() {
return $this->role;
}
/**
* #param string $description
* #return void
*/
public function setDescription($description) {
$this->description = $description;
}
/**
* #return string
*/
public function getDescription() {
return $this->description;
}
/**
* #param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference> $photo
* #return void
*/
public function setPhoto($photo) {
$this->photo = $photo;
}
/**
* #return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference>
*/
public function getPhoto() {
return $this->photo;
}
/**
* #return\TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Vendor\People\Domain\Model\PersonRelation>
*/
public function getRoles() {
return $this->roles;
}
}
?>
and this is role:
<?php
namespace Vendor\People\Domain\Model;
/**
* Class Role
* #scope prototype
* #entity
* #package Vendor\People\Domain\Model
*/
class Role extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
/**
* the role's title
* #var string
* #validate StringLength(minimum = 3, maximum = 50)
*/
protected $name;
public function __construct() {
}
/**
* #param string $name
* #return void
*/
public function setName($name) {
$this->name = $name;
}
/**
* #return string
*/
public function getName() {
return $this->name;
}
}
?>
ext_tables.sql:
CREATE TABLE tx_people_domain_model_person (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
tstamp int(11) DEFAULT '0' NOT NULL,
crdate int(11) DEFAULT '0' NOT NULL,
deleted tinyint(4) DEFAULT '0' NOT NULL,
hidden tinyint(4) DEFAULT '0' NOT NULL,
firstname varchar(225) DEFAULT '' NOT NULL,
lastname varchar(225) DEFAULT '' NOT NULL,
role varchar(225) DEFAULT '' NOT NULL,
roles int(11) unsigned DEFAULT '0' NOT NULL,
description mediumtext DEFAULT '' NOT NULL,
photo mediumblob NOT NULL,
PRIMARY KEY (uid),
KEY parent (pid)
) ENGINE=InnoDB;
CREATE TABLE tx_people_domain_model_role (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
tstamp int(11) DEFAULT '0' NOT NULL,
crdate int(11) DEFAULT '0' NOT NULL,
deleted tinyint(4) DEFAULT '0' NOT NULL,
hidden tinyint(4) DEFAULT '0' NOT NULL,
name varchar(225) DEFAULT '' NOT NULL,
PRIMARY KEY (uid)
KEY parent (pid)
) ENGINE=InnoDB;
CREATE TABLE tx_people_domain_model_person_role_rel (
uid_local int(11) unsigned DEFAULT '0' NOT NULL,
uid_foreign int(11) unsigned DEFAULT '0' NOT NULL,
sorting int(11) unsigned DEFAULT '0' NOT NULL,
KEY uid_local (uid_local),
KEY uid_foreign (uid_foreign)
) ENGINE=InnoDB;
TCA config:
tx_people_domain_model_person.php:
<?php
return array(
'ctrl' => array(
'title' => 'Person',
'label' => 'firstname',
'label_alt' => ',lastname',
'label_alt_force' => TRUE,
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'dividers2tabs' => TRUE,
'delete' => 'deleted',
'enablecolumns' => array(
'disabled' => 'hidden',
),
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('people') . 'ext_icon.gif'
),
'types' => array(
'1' => array('showitem' => 'firstname, lastname, role, description, photo, roles')
),
'columns' => array(
'hidden' => array(
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
'config' => array(
'type' => 'check'
)
),
'firstname' => array(
'exclude' => 0,
'label' => 'Vorname',
'config' => array(
'type' => 'input',
'size' => 225,
)
),
'lastname' => array(
'exclude' => 0,
'label' => 'Nachname',
'config' => array(
'type' => 'input',
'size' => 225,
)
),
'role' => array(
'exclude' => 0,
'label' => 'Rolle',
'config' => array(
'type' => 'input',
'size' => 225,
)
),
'description' => array(
'exclude' => 0,
'label' => 'Beschreibung',
'config' => array(
'type' => 'text',
)
),
'roles' => array(
'label' => 'Rollen',
'config' => array(
'type' => 'select',
'size' => 10,
'maxitems' => 3,
'foreign_table' => 'tx_people_domain_model_role',
'MM' => 'tx_people_domain_model_person_role_rel',
// 'foreign_table' => 'tx_people_domain_model_person_role_rel',
// 'foreign_field' => 'uid_person',
// 'foreign_label' => 'uid_role',
// 'foreign_selector' => 'uid_role',
// 'foreign_unique' => 'uid_role',
// 'foreign_sortby' => 'sorting',
),
),
'photo' => array(
'exclude' => 0,
'label' => 'Foto',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('photo', array(
'appearance' => array(
'createNewRelationLinkTitle' => 'Bild hinzufügen',
'collapseAll' => FALSE,
),
'maxitems' => 1,
), $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'])
),
),
);
?>
tx_domain_model_person_role_rel.php:
<?php
return array(
'ctrl' => array(
'title' => 'Relation Table',
'hideTable' => TRUE,
'sortBy' => 'sorting',
// 'tstamp' => 'tstamp',
// 'crdate' => 'crdate',
// 'dividers2tabs' => TRUE,
// 'delete' => 'deleted',
// 'enablecolumns' => array(
// 'disabled' => 'hidden',
// ),
// 'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('people') . 'ext_icon.gif'
),
'types' => array(
'0' => array('showitem' => 'uid_person, uid_role')
),
'palettes' => array(),
'columns' => array(
// 'hidden' => array(
// 'exclude' => 1,
// 'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
// 'config' => array(
// 'type' => 'check'
// )
// ),
'uid_local' => array(
'label' => 'Person',
'config' => array(
'type' => 'select',
'MM' => 'tx_people_domain_model_person_role_rel',
'foreign_table' => 'tx_people_domain_model_person',
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
),
),
'uid_foreign' => array(
'label' => 'Rolle',
'config' => array(
'type' => 'select',
'MM' => 'tx_people_domain_model_person_role_rel',
'foreign_table' => 'tx_people_domain_model_role',
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
),
),
),
);
?>
tx_domain_model_role.php:
<?php
return array(
'ctrl' => array(
'title' => 'Rolle',
'label' => 'name',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'dividers2tabs' => TRUE,
'delete' => 'deleted',
'enablecolumns' => array(
'disabled' => 'hidden',
),
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('people') . 'ext_icon.gif'
),
'types' => array(
'1' => array('showitem' => 'name')
),
'columns' => array(
'hidden' => array(
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
'config' => array(
'type' => 'check'
)
),
'name' => array(
'label' => 'Bezeichnung',
'config' => array(
'type' => 'input',
'size' => 225,
)
),
// 'people' => array(
// 'label' => 'Personen',
// 'config' => array(
// 'type' => 'inline',
// 'foreign_table' => 'tx_people_domain_model_person_role_rel',
// 'foreign_field' => 'uid_role',
// 'foreign_label' => 'uid_person'
// ) ,
// )
),
);
?>
ext_typoscript_setup.txt:
config.tx_extbase {
persistence {
classes {
Domain\People\Domain\Model\PersonRelation {
mapping {
tableName = tx_people_domain_model_person_role_rel
columns {
uid_local.mapOnProperty = person
uid_foreign.mapOnProperty = role
}
}
}
}
}
}
update debug output:
Domain\People\Domain\Model\Personprototypepersistent entity (uid=1, pid=18)
roles => TYPO3\CMS\Extbase\Persistence\ObjectStorageprototypeobject (3 items)
000000001bb500c600007fe33c9a2f36 => Domain\People\Domain\Model\PersonRelationprototypepersistent entity (uid=1, pid=20)
person => NULL
role => NULL
uid => 1 (integer)
_localizedUid => 1 (integer)modified
_languageUid => NULL
_versionedUid => 1 (integer)modified
pid => 20 (integer)
000000001bb5002400007fe33c9a2f36 => Domain\People\Domain\Model\PersonRelationprototypepersistent entity (uid=2, pid=20)
person => NULL
role => NULL
uid => 2 (integer)
_localizedUid => 2 (integer)modified
_languageUid => NULL
_versionedUid => 2 (integer)modified
pid => 20 (integer)
000000001bb500d100007fe33c9a2f36 => Domain\People\Domain\Model\PersonRelationprototypepersistent entity (uid=3, pid=20)
person => NULL
role => NULL
uid => 3 (integer)
_localizedUid => 3 (integer)modified
_languageUid => NULL
_versionedUid => 3 (integer)modified
pid => 20 (integer)
firstname => 'Max' (3 chars)
lastname => 'Mustermann' (10 chars)
role => 'Rolle' (5 chars)
photo => TYPO3\CMS\Extbase\Domain\Model\FileReferenceprototypepersistent entity (uid=25, pid=18)
description => 'Beschreibungstext' (17 chars)
uid => 1 (integer)
_localizedUid => 1 (integer)modified
_languageUid => NULL
_versionedUid => 1 (integer)modified
pid => 18 (integer)
So the problem is that I need to access those related objects (or the roles of a person) in the frontend.
edit: I think I'm a bit confused about the type of relation I need at all right now. 1 Person can have n roles. I don't want to relate people to roles later on anyways. I just want to create roles and later on assign roles to different people. So it would be a 1:n relation I guess. If that makes it any easier.
The solution was to add the following methods and variables in my Person class:
/**
* roles
*
* #var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Domain\People\Domain\Model\Role>
*/
protected $roles = NULL;
/**
* __construct
*/
public function __construct() {
//Do not remove the next line: It would break the functionality
$this->initStorageObjects();
}
/**
* Initializes all ObjectStorage properties
* Do not modify this method!
* It will be rewritten on each save in the extension builder
* You may modify the constructor of this class instead
*
* #return void
*/
protected function initStorageObjects() {
$this->roles = new \TYPO3\CMS\Extbase\Persistence\ObjectStorage();
}
/**
* Adds a Role
*
* #param \Domain\People\Domain\Model\Role $role
* #return void
*/
public function addRole(\Domain\People\Domain\Model\Role $role) {
$this->roles->attach($role);
}
/**
* Removes a Role
*
* #param \Domain\People\Domain\Model\Role $roleToRemove The Role to be removed
* #return void
*/
public function removeRole(\Domain\People\Domain\Model\Role $roleToRemove) {
$this->roles->detach($roleToRemove);
}
/**
* Returns the roles
*
* #return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Domain\People\Domain\Model\Role> $roles
*/
public function getRoles() {
return $this->roles;
}
/**
* Sets the roles
*
* #param \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\Domain\People\Domain\Model\Role> $roles
* #return void
*/
public function setRoles(\TYPO3\CMS\Extbase\Persistence\ObjectStorage $roles) {
$this->roles = $roles;
}

Not able to add object in sql database with extbase / typo3

I building my fist extension in typo3 6.2 with the extentions builder but i'm not able to add any record to the database. I'm reading an XML file and want to put the Ad data in the database. The problem is that notting is happening, no error and no record added in the database. Does anyone have a idee on what i'm doing wrong?
AdsController
class AdsController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
public function insertAdByXML($xml) {
$ad = new \MTR\Mtclnt\Domain\Model\Ads();
$ad->setExtId((int) $xml->ad->ad_id);
$ad->setAdCustId((int) $xml->customer_id);
$this->adsRepository->add($ad);
print_r($ad);
}
}
Output print_r
MTR\Mtclnt\Domain\Model\Ads Object
(
[extId:protected] => 438
[adCustId:protected] => 17605
[adCatId:protected] =>
[adStatus:protected] => 0
[adBrand:protected] =>
[adType:protected] =>
[adYear:protected] =>
[adHours:protected] =>
[adWeight:protected] =>
[adStateNl:protected] =>
[adStateEn:protected] =>
[adStateDe:protected] =>
[adPrice:protected] =>
[adCurrency:protected] =>
[adPriceTypeNl:protected] =>
[adPriceTypeEn:protected] =>
[adPriceTypeDe:protected] =>
[adCusRef:protected] =>
[adMovie:protected] =>
[adSpotlight:protected] =>
[adCarrouselImage:protected] =>
[adOptionsNl:protected] =>
[adOptionsEn:protected] =>
[adOptionsDe:protected] =>
[adDescNl:protected] =>
[adDescEn:protected] =>
[adDescDe:protected] =>
[uid:protected] =>
[_localizedUid:protected] =>
[_languageUid:protected] =>
[_versionedUid:protected] =>
[pid:protected] =>
[_isClone:TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject:private] =>
[_cleanProperties:TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject:private] => Array
(
)
)
AdsRepository
class AdsRepository extends \TYPO3\CMS\Extbase\Persistence\Repository {
}
TCA
<?php
if (!defined ('TYPO3_MODE')) {
die ('Access denied.');
}
$GLOBALS['TCA']['tx_mtclnt_domain_model_ads'] = array(
'ctrl' => $GLOBALS['TCA']['tx_mtclnt_domain_model_ads']['ctrl'],
'interface' => array(
'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, ext_id, ad_cust_id, ad_cat_id, ad_status, ad_brand, ad_type, ad_year, ad_hours, ad_weight, ad_state_nl, ad_state_en, ad_state_de, ad_price, ad_currency, ad_price_type_nl, ad_price_type_en, ad_price_type_de, ad_cus_ref, ad_movie, ad_spotlight, ad_carrousel_image, ad_options_nl, ad_options_en, ad_options_de, ad_desc_nl, ad_desc_en, ad_desc_de',
),
'types' => array(
'1' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1, ext_id, ad_cust_id, ad_cat_id, ad_status, ad_brand, ad_type, ad_year, ad_hours, ad_weight, ad_state_nl, ad_state_en, ad_state_de, ad_price, ad_currency, ad_price_type_nl, ad_price_type_en, ad_price_type_de, ad_cus_ref, ad_movie, ad_spotlight, ad_carrousel_image, ad_options_nl, ad_options_en, ad_options_de, ad_desc_nl, ad_desc_en, ad_desc_de, --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access, starttime, endtime'),
),
'palettes' => array(
'1' => array('showitem' => ''),
),
'columns' => array(
'sys_language_uid' => array(
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.language',
'config' => array(
'type' => 'select',
'foreign_table' => 'sys_language',
'foreign_table_where' => 'ORDER BY sys_language.title',
'items' => array(
array('LLL:EXT:lang/locallang_general.xlf:LGL.allLanguages', -1),
array('LLL:EXT:lang/locallang_general.xlf:LGL.default_value', 0)
),
),
),
'l10n_parent' => array(
'displayCond' => 'FIELD:sys_language_uid:>:0',
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.l18n_parent',
'config' => array(
'type' => 'select',
'items' => array(
array('', 0),
),
'foreign_table' => 'tx_mtclnt_domain_model_ads',
'foreign_table_where' => 'AND tx_mtclnt_domain_model_ads.pid=###CURRENT_PID### AND tx_mtclnt_domain_model_ads.sys_language_uid IN (-1,0)',
),
),
'l10n_diffsource' => array(
'config' => array(
'type' => 'passthrough',
),
),
't3ver_label' => array(
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.versionLabel',
'config' => array(
'type' => 'input',
'size' => 30,
'max' => 255,
)
),
'hidden' => array(
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.hidden',
'config' => array(
'type' => 'check',
),
),
'starttime' => array(
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.starttime',
'config' => array(
'type' => 'input',
'size' => 13,
'max' => 20,
'eval' => 'datetime',
'checkbox' => 0,
'default' => 0,
'range' => array(
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
),
),
),
'endtime' => array(
'exclude' => 1,
'l10n_mode' => 'mergeIfNotBlank',
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.endtime',
'config' => array(
'type' => 'input',
'size' => 13,
'max' => 20,
'eval' => 'datetime',
'checkbox' => 0,
'default' => 0,
'range' => array(
'lower' => mktime(0, 0, 0, date('m'), date('d'), date('Y'))
),
),
),
'ext_id' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ext_id',
'config' => array(
'type' => 'input',
'size' => 4,
'eval' => 'int'
)
),
'ad_cust_id' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_cust_id',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_cat_id' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_cat_id',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_status' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_status',
'config' => array(
'type' => 'input',
'size' => 4,
'eval' => 'int'
)
),
'ad_brand' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_brand',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_type' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_type',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_year' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_year',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_hours' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_hours',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_weight' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_weight',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_state_nl' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_state_nl',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_state_en' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_state_en',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_state_de' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_state_de',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_price' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_price',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_currency' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_currency',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_price_type_nl' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_price_type_nl',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_price_type_en' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_price_type_en',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_price_type_de' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_price_type_de',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_cus_ref' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_cus_ref',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_movie' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_movie',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_spotlight' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_spotlight',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_carrousel_image' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_carrousel_image',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_options_nl' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_options_nl',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_options_en' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_options_en',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_options_de' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_options_de',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_desc_nl' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_desc_nl',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_desc_en' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_desc_en',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
'ad_desc_de' => array(
'exclude' => 1,
'label' => 'LLL:EXT:mtclnt/Resources/Private/Language/locallang_db.xlf:tx_mtclnt_domain_model_ads.ad_desc_de',
'config' => array(
'type' => 'input',
'size' => 30,
'eval' => 'trim'
),
),
),
);
Adsmodel
class Ads extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
/**
* extId
*
* #var integer
*/
protected $extId = 0;
/**
* adCustId
*
* #var string
*/
protected $adCustId = '';
/**
* adCatId
*
* #var string
*/
protected $adCatId = '';
/**
* adStatus
*
* #var integer
*/
protected $adStatus = 0;
/**
* adBrand
*
* #var string
*/
protected $adBrand = '';
/**
* adType
*
* #var string
*/
protected $adType = '';
/**
* adYear
*
* #var string
*/
protected $adYear = '';
/**
* adHours
*
* #var string
*/
protected $adHours = '';
/**
* adWeight
*
* #var string
*/
protected $adWeight = '';
/**
* adStateNl
*
* #var string
*/
protected $adStateNl = '';
/**
* adStateEn
*
* #var string
*/
protected $adStateEn = '';
/**
* adStateDe
*
* #var string
*/
protected $adStateDe = '';
/**
* adPrice
*
* #var string
*/
protected $adPrice = '';
/**
* adCurrency
*
* #var string
*/
protected $adCurrency = '';
/**
* adPriceTypeNl
*
* #var string
*/
protected $adPriceTypeNl = '';
/**
* adPriceTypeEn
*
* #var string
*/
protected $adPriceTypeEn = '';
/**
* adPriceTypeDe
*
* #var string
*/
protected $adPriceTypeDe = '';
/**
* adCusRef
*
* #var string
*/
protected $adCusRef = '';
/**
* adMovie
*
* #var string
*/
protected $adMovie = '';
/**
* adSpotlight
*
* #var string
*/
protected $adSpotlight = '';
/**
* adCarrouselImage
*
* #var string
*/
protected $adCarrouselImage = '';
/**
* adOptionsNl
*
* #var string
*/
protected $adOptionsNl = '';
/**
* adOptionsEn
*
* #var string
*/
protected $adOptionsEn = '';
/**
* adOptionsDe
*
* #var string
*/
protected $adOptionsDe = '';
/**
* adDescNl
*
* #var string
*/
protected $adDescNl = '';
/**
* adDescEn
*
* #var string
*/
protected $adDescEn = '';
/**
* adDescDe
*
* #var string
*/
protected $adDescDe = '';
/**
* Returns the adBrand
*
* #return string $adBrand
*/
public function getAdBrand() {
return $this->adBrand;
}
/**
* Sets the adBrand
*
* #param string $adBrand
* #return void
*/
public function setAdBrand($adBrand) {
$this->adBrand = $adBrand;
}
/**
* Returns the adType
*
* #return string adType
*/
public function getAdType() {
return $this->adType;
}
/**
* Sets the adType
*
* #param string $adType
* #return string adType
*/
public function setAdType($adType) {
$this->adType = $adType;
}
/**
* Returns the extId
*
* #return integer $extId
*/
public function getExtId() {
return $this->extId;
}
/**
* Sets the extId
*
* #param integer $extId
* #return void
*/
public function setExtId($extId) {
$this->extId = $extId;
}
/**
* Returns the adStatus
*
* #return integer $adStatus
*/
public function getAdStatus() {
return $this->adStatus;
}
/**
* Sets the adStatus
*
* #param integer $adStatus
* #return void
*/
public function setAdStatus($adStatus) {
$this->adStatus = $adStatus;
}
/**
* Returns the adYear
*
* #return string $adYear
*/
public function getAdYear() {
return $this->adYear;
}
/**
* Sets the adYear
*
* #param string $adYear
* #return void
*/
public function setAdYear($adYear) {
$this->adYear = $adYear;
}
/**
* Returns the adHours
*
* #return string $adHours
*/
public function getAdHours() {
return $this->adHours;
}
/**
* Sets the adHours
*
* #param string $adHours
* #return void
*/
public function setAdHours($adHours) {
$this->adHours = $adHours;
}
/**
* Returns the adWeight
*
* #return string $adWeight
*/
public function getAdWeight() {
return $this->adWeight;
}
/**
* Sets the adWeight
*
* #param string $adWeight
* #return void
*/
public function setAdWeight($adWeight) {
$this->adWeight = $adWeight;
}
/**
* Returns the adStateNl
*
* #return string $adStateNl
*/
public function getAdStateNl() {
return $this->adStateNl;
}
/**
* Sets the adStateNl
*
* #param string $adStateNl
* #return void
*/
public function setAdStateNl($adStateNl) {
$this->adStateNl = $adStateNl;
}
/**
* Returns the adStateEn
*
* #return string $adStateEn
*/
public function getAdStateEn() {
return $this->adStateEn;
}
/**
* Sets the adStateEn
*
* #param string $adStateEn
* #return void
*/
public function setAdStateEn($adStateEn) {
$this->adStateEn = $adStateEn;
}
/**
* Returns the adStateDe
*
* #return string $adStateDe
*/
public function getAdStateDe() {
return $this->adStateDe;
}
/**
* Sets the adStateDe
*
* #param string $adStateDe
* #return void
*/
public function setAdStateDe($adStateDe) {
$this->adStateDe = $adStateDe;
}
/**
* Returns the adPrice
*
* #return string $adPrice
*/
public function getAdPrice() {
return $this->adPrice;
}
/**
* Sets the adPrice
*
* #param string $adPrice
* #return void
*/
public function setAdPrice($adPrice) {
$this->adPrice = $adPrice;
}
/**
* Returns the adCurrency
*
* #return string $adCurrency
*/
public function getAdCurrency() {
return $this->adCurrency;
}
/**
* Sets the adCurrency
*
* #param string $adCurrency
* #return void
*/
public function setAdCurrency($adCurrency) {
$this->adCurrency = $adCurrency;
}
/**
* Returns the adPriceTypeNl
*
* #return string $adPriceTypeNl
*/
public function getAdPriceTypeNl() {
return $this->adPriceTypeNl;
}
/**
* Sets the adPriceTypeNl
*
* #param string $adPriceTypeNl
* #return void
*/
public function setAdPriceTypeNl($adPriceTypeNl) {
$this->adPriceTypeNl = $adPriceTypeNl;
}
/**
* Returns the adPriceTypeEn
*
* #return string $adPriceTypeEn
*/
public function getAdPriceTypeEn() {
return $this->adPriceTypeEn;
}
/**
* Sets the adPriceTypeEn
*
* #param string $adPriceTypeEn
* #return void
*/
public function setAdPriceTypeEn($adPriceTypeEn) {
$this->adPriceTypeEn = $adPriceTypeEn;
}
/**
* Returns the adPriceTypeDe
*
* #return string $adPriceTypeDe
*/
public function getAdPriceTypeDe() {
return $this->adPriceTypeDe;
}
/**
* Sets the adPriceTypeDe
*
* #param string $adPriceTypeDe
* #return void
*/
public function setAdPriceTypeDe($adPriceTypeDe) {
$this->adPriceTypeDe = $adPriceTypeDe;
}
/**
* Returns the adCusRef
*
* #return string $adCusRef
*/
public function getAdCusRef() {
return $this->adCusRef;
}
/**
* Sets the adCusRef
*
* #param string $adCusRef
* #return void
*/
public function setAdCusRef($adCusRef) {
$this->adCusRef = $adCusRef;
}
/**
* Returns the adMovie
*
* #return string $adMovie
*/
public function getAdMovie() {
return $this->adMovie;
}
/**
* Sets the adMovie
*
* #param string $adMovie
* #return void
*/
public function setAdMovie($adMovie) {
$this->adMovie = $adMovie;
}
/**
* Returns the adSpotlight
*
* #return string $adSpotlight
*/
public function getAdSpotlight() {
return $this->adSpotlight;
}
/**
* Sets the adSpotlight
*
* #param string $adSpotlight
* #return void
*/
public function setAdSpotlight($adSpotlight) {
$this->adSpotlight = $adSpotlight;
}
/**
* Returns the adCarrousselImage
*
* #return boolean $adCarrousselImage
*/
public function getAdCarrousselImage() {
return $this->adCarrousselImage;
}
/**
* Sets the adCarrousselImage
*
* #param boolean $adCarrousselImage
* #return void
*/
public function setAdCarrousselImage($adCarrousselImage) {
$this->adCarrousselImage = $adCarrousselImage;
}
/**
* Returns the boolean state of adCarrousselImage
*
* #return boolean
*/
public function isAdCarrousselImage() {
return $this->adCarrousselImage;
}
/**
* Returns the adOptionsNl
*
* #return string $adOptionsNl
*/
public function getAdOptionsNl() {
return $this->adOptionsNl;
}
/**
* Sets the adOptionsNl
*
* #param string $adOptionsNl
* #return void
*/
public function setAdOptionsNl($adOptionsNl) {
$this->adOptionsNl = $adOptionsNl;
}
/**
* Returns the adOptionsEn
*
* #return string $adOptionsEn
*/
public function getAdOptionsEn() {
return $this->adOptionsEn;
}
/**
* Sets the adOptionsEn
*
* #param string $adOptionsEn
* #return void
*/
public function setAdOptionsEn($adOptionsEn) {
$this->adOptionsEn = $adOptionsEn;
}
/**
* Returns the adOptionsDe
*
* #return string $adOptionsDe
*/
public function getAdOptionsDe() {
return $this->adOptionsDe;
}
/**
* Sets the adOptionsDe
*
* #param string $adOptionsDe
* #return void
*/
public function setAdOptionsDe($adOptionsDe) {
$this->adOptionsDe = $adOptionsDe;
}
/**
* Returns the adDescNl
*
* #return string $adDescNl
*/
public function getAdDescNl() {
return $this->adDescNl;
}
/**
* Sets the adDescNl
*
* #param string $adDescNl
* #return void
*/
public function setAdDescNl($adDescNl) {
$this->adDescNl = $adDescNl;
}
/**
* Returns the adDescEn
*
* #return string $adDescEn
*/
public function getAdDescEn() {
return $this->adDescEn;
}
/**
* Sets the adDescEn
*
* #param string $adDescEn
* #return void
*/
public function setAdDescEn($adDescEn) {
$this->adDescEn = $adDescEn;
}
/**
* Returns the adDescDe
*
* #return string $adDescDe
*/
public function getAdDescDe() {
return $this->adDescDe;
}
/**
* Sets the adDescDe
*
* #param string $adDescDe
* #return void
*/
public function setAdDescDe($adDescDe) {
$this->adDescDe = $adDescDe;
}
/**
* Returns the adCatId
*
* #return string $adCatId
*/
public function getAdCatId() {
return $this->adCatId;
}
/**
* Sets the adCatId
*
* #param string $adCatId
* #return void
*/
public function setAdCatId($adCatId) {
$this->adCatId = $adCatId;
}
/**
* Returns the adCustId
*
* #return string $adCustId
*/
public function getAdCustId() {
return $this->adCustId;
}
/**
* Sets the adCustId
*
* #param string $adCustId
* #return void
*/
public function setAdCustId($adCustId) {
$this->adCustId = $adCustId;
}
/**
* __construct
*/
public function __construct() {
//Do not remove the next line: It would break the functionality
$this->initStorageObjects();
}
/**
* Initializes all ObjectStorage properties
* Do not modify this method!
* It will be rewritten on each save in the extension builder
* You may modify the constructor of this class instead
*
* #return void
*/
protected function initStorageObjects() {
}
/**
* Returns the adUsed
*
* #return string $adUsed
*/
public function getAdUsed() {
return $this->adUsed;
}
/**
* Sets the adUsed
*
* #param string $adUsed
* #return void
*/
public function setAdUsed($adUsed) {
$this->adUsed = $adUsed;
}
}