質問

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