[TYPO3-english] tt_content fields using extbase repository method typo3

Arun Chandran arunchandran2010 at gmail.com
Wed May 27 13:05:30 CEST 2015


I am trying to develop a custom extension using typo3 extbase repository
method. I want to fetch tt_content "pi_flexform" field value in my
extension.

For achieving this I've followed persistence method.

In typoscript configuration files I've added like this;

plugin.tx_myext{
   persistence {
        classes {
            \TYPO3\MyExt\Domain\Model\Myext {
                mapping {
                    tableName = tt_content
                    recordType = \TYPO3\MyExt\Domain\Model\Myext
                    columns {
                        pi_flexform.mapOnProperty = piflexform
                    }
                }
            }
        }
    }
}

In my model file I've implemented the following code;

/**
 * @var string
 */
protected $piflexform;

/**
 * @return the $piflexform
 */
public function getPiflexform()
{
    return $this->piflexform;
}

/**
 * @param string $piflexform
 */
public function setPiflexform($piflexform)
{
    $this->piflexform = $piflexform;
}

And also in the repository file;

$queryStmt = "SELECT pi_flexform FROM tt_content WHERE CType = 'dce_dce10'
AND pid = 1 AND sys_language_uid = 0";
$query = $this->createQuery();
$query->statement( $queryStmt );
return $query->execute();
But it returns an empty object.

TYPO3\CMS\Extbase\Persistence\Generic\QueryResultprototypeobject (empty)
   0 => TYPO3\VstRssfeed\Domain\Model\Vstrssfeedprototypepersistent entity
(uid=0, pid=0)
      piflexform => NULL
      uid => 0 (integer)
      _localizedUid => 0 (integer)modified
      _languageUid => 0 (integer)modified
      _versionedUid => 0 (integer)modified
      pid => 0 (integer)

Can you guys please help me to solve this problem? Thanks in advance.

Thank & Regards,
Arun Chandran
PIT Solutions Pvt Ltd.


More information about the TYPO3-english mailing list