모든 프론트 엔드 사용자를 확보해야하는 확장 프로그램이 있습니다. 작동 (1)Typo3 6.1 Extbase - 모든 fe 사용자 선택
/**
* @var \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository $feUserRepository
*/
$feUserRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Domain\\Repository\\FrontendUserRepository');
$allUsers = $feUserRepository->findAll();
$user = $feUserRepository->findByUid(1);
findByUid하지만 findall은() 하늘의 객체를 반환 : 나는이 시도. 여기서 내가 뭘 잘못하고 있니?
UPDATE :
그것은 뉴스 확장에 관하여이다. tx_xxnews_domain_model_news와 fe_users 사이에는 mm 관계가 있으므로 어떤 사용자가 어떤 뉴스에 액세스했는지 추적 할 수 있습니다. 뉴스
TCA :
'columns' => array(
...
'fe_users' => array(
'exclude' => 0,
'label' => 'LLL:EXT:xx_news/Resources/Private/Language/locallang_db.xlf:tx_xxnews_domain_model_news.fe_users',
'config' => array(
'type' => 'select',
'foreign_table' => 'fe_users',
'MM' => 'tx_xxnews_news_feuser_mm',
'size' => 10,
'autoSizeMax' => 30,
'maxitems' => 9999,
'multiple' => 0,
),
),
...
),
내가하지 않았다 사람과는 별도로 뉴스를 액세스 할 수있는 사용자를 보여, 그래서 사용자 정의 함수의 내용을 보여 2 이상의 열이있다 :
'reading_users' => array (
'exclude' => 0,
'label' => 'LLL:EXT:xx_news/Resources/Private/Language/locallang_db.xlf:tx_xxnews_domain_model_news.user_info',
'config' => array (
'type' => 'user',
'size' => '30',
'userFunc' => 'EXT:xx_news/Classes/TCA/class.tx_xxnews_tca.php:tx_examples_tca->readersInfo',
'parameters' => array(
'read' => TRUE
)
)
),
'not_reading_users' => array (
'exclude' => 0,
'label' => 'LLL:EXT:xx_news/Resources/Private/Language/locallang_db.xlf:tx_xxnews_domain_model_news.user_info',
'config' => array (
'type' => 'user',
'size' => '30',
'userFunc' => 'EXT:xx_news/Classes/TCA/class.tx_xxnews_tca.php:tx_examples_tca->readersInfo',
'parameters' => array(
'read' => FALSE
)
)
),
class.tx_xxnews_tca.php :
class tx_examples_tca {
/**
* @var \Vendor\XxNews\Domain\Repository\NewsRepository $newsRepository
*/
protected $newsRepository;
/**
* Class constructor
*/
public function __construct() {
$this->newsRepository = new \Vendor\XxNews\Domain\Repository\NewsRepository;
}
public function readersInfo($params) {
/**
* @var \TYPO3\CMS\Extbase\Domain\Repository\FrontendUserRepository $feUserRepository
*/
$feUserRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Domain\\Repository\\FrontendUserRepository');
$allUsers = $feUserRepository->findAll();
$user = $feUserRepository->findByUid(1);
var_dump($allUsers); //EMPTY
var_dump($user); //OK
}
}
감사합니다.
안녕 로렌츠을. FrontendUser 모델을 확장하지 않으므로 레코드 유형이 정의되어 있지 않습니다. 필자는 tx_extbase_type 필드를 'Tx_Extbase_Domain_Model_FrontendUser'로 업데이트했지만 findAll()은 아무것도 반환하지 않았습니다. 나는 모델을 확장하지 않고 단지 코어 모델을 사용하는 fe 사용자 목록을 얻고 싶다. 고맙습니다. – cili
프론트 엔드 또는 백엔드 확장 기능입니까? 스토리지 PID가 설정되어 있습니까? – lorenz
fe_users와 mm 관련 뉴스 확장 프로그램입니다. 업데이트를 확인하십시오. – cili