ItemCollection

This page is still incomplete. Please help us to write a comprehensive CONTENIDO documentation.

ItemCollection->create() returns

Since CONTENIDO version 4.9.5 all ItemCollection create()-functions has to return an item object for successful and false Boolean for unsuccessful call.

Example
<?php
/**
 * Simple example: Creates a content entry
 *
 * @param int $idartlang
 * @paramt string $lastmodified
 * @return false|cApiContent
 */
public function create($idartlang, $lastmodified) {
    $item = parent::createNewItem();
    
    if ($lastmodified == '') {
        return false;
    } else {
        $item->set('idartlang', $idartlang);
        $item->set('lastmodified', $lastmodifiedg);
        $item->store();
        
        return $item;
    }
        
}
?>

Changes since version CONTENIDO 4.9.5

Class

Before CON 4.9.5

Since CON 4.9.5

cApiDbfsCollection

Unsuccessful: NULL

Successful: $item

Unsuccessful: false

Successful: $item

cApiFrontendPermissionCollection

Unsuccessful: NULL

Successful: $perm

Unsuccessful: false

Successful: $perm

cApiGroupCollection

Unsuccessful: NULL

Successful: $item

Unsuccessful: false

Successful: $item

cApiMailLogCollection

Successful: $item->get(‘idmail’)

Successful: $item

cApiMailLogSuccessCollection

Successful: true

Successful: $item