Hallo nochmals

Hat tatsächlich niemand hierzu einen Tipp für mich?

Johannes

-----Ursprüngliche Nachricht-----
Von: typo3-german-boun...@lists.typo3.org
[mailto:typo3-german-boun...@lists.typo3.org] Im Auftrag von Johannes C.
Schulz - EnzephaloN IT-Solutions
Gesendet: Montag, 30. Juni 2014 12:16
An: typo3-german@lists.typo3.org
Betreff: [TYPO3-german] Objekt im FrontendUser ablegen

 

Hallo typo3-Freunde

 

Ich schreibe gerade eine Extension für 6.2.x neu und möchte dabei einiges
verbessern was ich unter 4.5.x irgendwie komisch gelöst hatte. Eine Aufgabe
ist, das von mir erstellte Objekt auch in den zugeordneten FrontendUser
abzulegen. Der Verweis aus dem Objekt auf den FrontendUser funktioniert, der
zurück wird aber nicht gespeichert.

 

In meiner ext_tables.php erweitere ich den FrontendUser:

 

/**

* Extend fe_user

*/

$tempColumns = Array(

    "tx_accreditation_accreditation" => Array(

        "exclude" => 1,

        "label" => "Akkreditierungen",

        "config" =>array(

            "type" => "inline",

            "foreign_table" =>
"tx_accreditation_domain_model_accreditation",

            "foreign_table_where" => "ORDER BY
tx_accreditation_domain_model_accreditation.year DESC",

            "size" => 10,

            "minitems" => 0,

            "maxitems" => 999,

        ),

    ),

);

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns("fe_users"
, $tempColumns, 1);

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes("fe_use
rs", "--div--;Akkreditierungen, tx_accreditation_accreditation;;;;1-1-1");

 

Das vom FrontendUser abgeleitete Model erweitere ich um mein Feld:

 

class User extends \TYPO3\CMS\Extbase\Domain\Model\FrontendUser {

 

        /**

                * @var
\TYPO3\CMS\Extbase\Persistence\ObjectStorage<EnzephaloN\Accreditation\Domain
\Model\Accreditation> $accreditation

                * @validate NotEmpty

                */

               protected $accreditation;

        

        /**

                * Constructs a new Front-End User

                *

                * @api

                * @param string $username

                * @param string $password

                */

                public function __construct($username = '', $password = '')
{

                               $this->username = $username;

                               $this->password = $password;

                               $this->usergroup = new
\TYPO3\CMS\Extbase\Persistence\ObjectStorage();

                $this->accreditation = new
\TYPO3\CMS\Extbase\Persistence\ObjectStorage();

                }

 

                Setter, getter, addAccreditation…

 

Der User wird wie gesagt mittels
$this->objectManager->get(`EnzephaloN\\Accreditation\\Domain\\Model\\User‘);
angelegt. Doch wenn ich $user->addAccreditation($newAccreditation); aufrufe,
passiert original nix. 

 

Ein Dump auf $newAccreditation->getUser(); liefert mir einen ObjectStorage
zurück – wie komme ich an das User-Objekt????

 

Wäre für Hilfe hier echt dankbar.

 

Johannes

_______________________________________________
TYPO3-german mailing list
TYPO3-german@lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german


_______________________________________________
TYPO3-german mailing list
TYPO3-german@lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german

Antwort per Email an