Я обновил свою установку типо3 с версии 11 по 12. У меня есть расширение, которое расширяет новую систему, и я создал модель автора
class News extends \GeorgRinger\News\Domain\Model\NewsDefault< /code>
позже я получаю UID из этой модели в спросе. < /p>
class NewsDemand extends \GeorgRinger\News\Domain\Model\Dto\NewsDemand
{
/**
* @var \BB\BbExtendNews\Domain\Model\Authors
*/
protected $newsAuthor;
/**
* Set news author
*
* @param \BB\BbExtendNews\Domain\Model\Authors $newsAuthor
* @return NewsDemand
*/
public function setNewsAuthor($newsAuthor)
{
$this->newsAuthor = $newsAuthor;
return $this;
}
/**
* Get news author
*
* @return \BB\BbExtendNews\Domain\Model\Authors
*/
public function getNewsAuthor()
{
return $this->newsAuthor;
}
}
< /code>
В режиме отладки переменная существует, но значение не передается. Как я могу получить доступ/получить это значение в спросе?
Extbase Variable Dump
GeorgRinger\News\Domain\Model\Dto\NewsDemandprototypetransient entity
test => protected'' (0 chars)
categories => protectedarray(5 items)
categoryConjunction => protected'or' (2 chars)
includeSubCategories => protectedFALSE
author => protected'' (0 chars)
tags => protected'' (0 chars)
archiveRestriction => protected'' (0 chars)
timeRestriction => protected'' (0 chars)
timeRestrictionHigh => protected'' (0 chars)
topNewsRestriction => protected0 (integer)
dateField => protected'datetime' (8 chars)
month => protected0 (integer)
year => protected0 (integer)
day => protected0 (integer)
searchFields => protected'' (0 chars)
search => protectedNULL
order => protected'datetime desc' (13 chars)
orderByAllowed => protected'sorting,author,uid,title,teaser,author,tstamp,crdate,datetime,categories.tit
le' (78 chars)
topNewsFirst => protectedFALSE
storagePage => protected'1358' (4 chars)
limit => protected0 (integer)
offset => protected0 (integer)
excludeAlreadyDisplayedNews => protectedFALSE
hideIdList => protected'' (0 chars)
idList => protected'' (0 chars)
action => protected'BB\BbExtendNews\Controller\NewsController::listAuthorAction' (59 chars)
class => protected'BB\BbExtendNews\Controller\NewsController' (41 chars)
types => protectedarray(empty)
_customSettings => protectedarray(empty)
newsAuthor => protectedNULL
uid => protectedNULL
_localizedUid => protectedNULL
_languageUid => protectedNULL
_versionedUid => protectedNULL
pid => protectedNULL
< /code>
newscontroller.php
class NewsController extends \GeorgRinger\News\Controller\NewsController {
public function listAuthorAction(?array $overwriteDemand = null): ResponseInterface
{
$demand = $this->createDemandObjectFromSettings($this->settings);
$demand->setActionAndClass(__METHOD__, self::class);
if ((int)($this->settings['disableOverrideDemand'] ?? 1) !== 1 && $overwriteDemand !== null) {
$demand = $this->overwriteDemandObject($demand, $overwriteDemand);
}
/* It doesn't work */ if ($this->request->hasArgument('newsAuthor')) {
$newsAuthor = (int)$this->request->getArgument('newsAuthor');
$demand->setNewsAuthor($newsAuthor);
}
< /code>
newsrepository.php
if ($demand->getNewsAuthor()) {
$constraints['newsAuthor'] = $query->equals('newsAuthor', $demand->getNewsAuthor());
}
< /code>
С помощью типов 3 версии 11 все работает
Я также создал простую переменную (не объект), но это также не получено в спросе. Как я могу получить доступ/получить эти значения в спросе? Любой пример или руководство о том, как правильно расширить или изменять спрос, будет очень оценен.
Подробнее здесь: https://stackoverflow.com/questions/797 ... m-extensio
Как правильно передать пользовательские переменные для требования в расширении новостной системы Sypo3 12? ⇐ Php
Кемеровские программисты php общаются здесь
1755155337
Anonymous
Я обновил свою установку типо3 с версии 11 по 12. У меня есть расширение, которое расширяет новую систему, и я создал модель автора
class News extends \GeorgRinger\News\Domain\Model\NewsDefault< /code>
позже я получаю UID из этой модели в спросе. < /p>
class NewsDemand extends \GeorgRinger\News\Domain\Model\Dto\NewsDemand
{
/**
* @var \BB\BbExtendNews\Domain\Model\Authors
*/
protected $newsAuthor;
/**
* Set news author
*
* @param \BB\BbExtendNews\Domain\Model\Authors $newsAuthor
* @return NewsDemand
*/
public function setNewsAuthor($newsAuthor)
{
$this->newsAuthor = $newsAuthor;
return $this;
}
/**
* Get news author
*
* @return \BB\BbExtendNews\Domain\Model\Authors
*/
public function getNewsAuthor()
{
return $this->newsAuthor;
}
}
< /code>
В режиме отладки переменная существует, но значение не передается. Как я могу получить доступ/получить это значение в спросе?
Extbase Variable Dump
GeorgRinger\News\Domain\Model\Dto\NewsDemandprototypetransient entity
test => protected'' (0 chars)
categories => protectedarray(5 items)
categoryConjunction => protected'or' (2 chars)
includeSubCategories => protectedFALSE
author => protected'' (0 chars)
tags => protected'' (0 chars)
archiveRestriction => protected'' (0 chars)
timeRestriction => protected'' (0 chars)
timeRestrictionHigh => protected'' (0 chars)
topNewsRestriction => protected0 (integer)
dateField => protected'datetime' (8 chars)
month => protected0 (integer)
year => protected0 (integer)
day => protected0 (integer)
searchFields => protected'' (0 chars)
search => protectedNULL
order => protected'datetime desc' (13 chars)
orderByAllowed => protected'sorting,author,uid,title,teaser,author,tstamp,crdate,datetime,categories.tit
le' (78 chars)
topNewsFirst => protectedFALSE
storagePage => protected'1358' (4 chars)
limit => protected0 (integer)
offset => protected0 (integer)
excludeAlreadyDisplayedNews => protectedFALSE
hideIdList => protected'' (0 chars)
idList => protected'' (0 chars)
action => protected'BB\BbExtendNews\Controller\NewsController::listAuthorAction' (59 chars)
class => protected'BB\BbExtendNews\Controller\NewsController' (41 chars)
types => protectedarray(empty)
_customSettings => protectedarray(empty)
newsAuthor => protectedNULL
uid => protectedNULL
_localizedUid => protectedNULL
_languageUid => protectedNULL
_versionedUid => protectedNULL
pid => protectedNULL
< /code>
newscontroller.php
class NewsController extends \GeorgRinger\News\Controller\NewsController {
public function listAuthorAction(?array $overwriteDemand = null): ResponseInterface
{
$demand = $this->createDemandObjectFromSettings($this->settings);
$demand->setActionAndClass(__METHOD__, self::class);
if ((int)($this->settings['disableOverrideDemand'] ?? 1) !== 1 && $overwriteDemand !== null) {
$demand = $this->overwriteDemandObject($demand, $overwriteDemand);
}
/* It doesn't work */ if ($this->request->hasArgument('newsAuthor')) {
$newsAuthor = (int)$this->request->getArgument('newsAuthor');
$demand->setNewsAuthor($newsAuthor);
}
< /code>
newsrepository.php
if ($demand->getNewsAuthor()) {
$constraints['newsAuthor'] = $query->equals('newsAuthor', $demand->getNewsAuthor());
}
< /code>
С помощью типов 3 версии 11 все работает
Я также создал простую переменную (не объект), но это также не получено в спросе. Как я могу получить доступ/получить эти значения в спросе? Любой пример или руководство о том, как правильно расширить или изменять спрос, будет очень оценен.
Подробнее здесь: [url]https://stackoverflow.com/questions/79729630/how-to-properly-pass-custom-variables-to-demand-in-typo3-12-news-system-extensio[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия