문제

I have a NewsRepository and a News model. The storagePid is 74. I have a script which checks if the endtime field of the new record is overdue. If it is, I want to move the record in another folder (UID 170).

When I do:

$news = $newsRepository->findByUid( 1 );
$news->setTitle( 'News ' . rand(1,99999) );
$news->setPid( 170 );
$newsRepository->update( $news );

The title is changed, but the PID is not.

So, how can I move the new onto another page?

도움이 되었습니까?

해결책

You need to add the pid to the TCA.

This is the correct way, so it wont be displayed in the backend.

'pid' => array(
    'config' => array(
        'type' => 'passthrough',
    )
),

다른 팁

Looks like the pid filed should be set in TCA also. I added

'pid' => Array(
    'exclude' => 1,
    'label' => 'PID',
    'config' => array(
        'type' => 'none',
    )
),

in the columns section of the TCA and now the PID is saved.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top