查询过滤器对象仅工作一次 - extbase 6.2

时间:2016-10-17 16:06:38

标签: typo3 extbase typo3-6.2.x

在我的extbase存储库中,我构建了一个类似本教程中描述的查询函数:this并且它使用了一个过滤器对象$demand
所以我为我的过滤器创建了一个类,以便处理流体中的对象。

它有效,但只有一次 - 我可以改变一些东西,点击“过滤器”它就可以了 但是,如果我再次更改某些内容并单击“过滤器”,它会跳回到之前的值,并且没有任何变化。

我觉得这可能与缓存有关,但我不确定 当我调试过滤器对象时,它在第二次单击“过滤器”后没有显示我的调试代码,因为当我注意到没有任何改变时它就是这样做的。

如何根据需要多次更改我的过滤器设置?

我的过滤器类:

class AppointmentFilter extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {

    /**
     * future
     *
     * @var int
     */
    protected $future = 1;

    /**
     * booked
     *
     * @var int
     */
    protected $booked = 2;

    /**
     * student
     *
     * @var \vendor\extension\Domain\Model\Student
     */
    protected $student = NULL;

    /**
     * expertise
     *
     * @var \vendor\extension\Domain\Model\Expertise
     */
    protected $expertise = NULL;

    function getFuture() {
        return $this->future;
    }

    function getBooked() {
        return $this->booked;
    }

    function getStudent() {
        return $this->student;
    }

    function getExpertise() {
        return $this->expertise;
    }

    function setFuture($future) {
        $this->future = $future;
    }

    function setBooked($booked = NULL) {
        $this->booked = $booked;
    }

    function setStudent(\vendor\extension\Domain\Model\Student $student = NULL) {
        $this->student = $student;
    }

    function setExpertise(\vendor\extension\Domain\Model\Expertise $expertise = NULL) {
        $this->expertise = $expertise;
    }

}

相应的液体形式:

<f:form action="list" name="appointmentFilter" 
            class="filter-form" 
            object="{appointmentFilter}" 
            arguments="{students:students,expertises:expertises}">  
        Termine:
        <label>
            <f:form.radio property="future" value="1"/> Bevorstehende
            <f:form.radio property="future" value="0"/> Vergangene
        </label>
        <label>
            <f:form.radio property="booked" value="2"/> Alle
            <f:form.radio property="booked" value="1"/> Gebuchte
            <f:form.radio property="booked" value="0"/> Freie
        </label>
        <label>
            Studenten:
            <f:form.select property="student" options="{students}" optionLabelField="fullName" prependOptionLabel="Alle Studenten" class="filterSelect" />                 
        </label>
        <label>
            Expertise:
            <f:form.select property="expertise" options="{expertises}" optionLabelField="name" prependOptionLabel="Alle" class="filterSelect" />
        </label>

        <f:form.submit value="Filter anwenden" class="rm-with-js" />
    </f:form> 

1 个答案:

答案 0 :(得分:2)

根据您的描述,这是一个缓存问题。您可以通过将其添加到localconf.php中的插件配置中的第二个数组中来将操作设置为不可访问。例如:

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
    $_EXTKEY,
    'Pi1',
    array(
        'Controller' => 'list, cachedAction',
    ),
    // this is the array for noncachable actions
    array(
        'Controller' => 'list',
    )
);