webCOMAND

Content::set_dimension()

Updates this object to have the given dimensions. This will not guarantee that the object dimension is unique; i.e. two users can simultaneously add two 'French' web pages (this can be resolved by the users later and will not break the query engine).

Prototype

boolean set_dimension(mixed $dimension_data)

Parameters

  • dimension_data - An array or collection of Dimension objects to apply.

Return

TRUE if the specified content dimensions were set.  FALSE if they could not be set, which may be because an object with the same dimensions already exists, authorizations, etc.  If FALSE is returned an error will be logged to the repo SystemLog.

Example

$repo = comand::repo();

// get Spanish Language Dimension Value
$es = $repo->get_first('FROM Language WHERE Title='Spanish');

// create a new Article in Spanish
$article_en = $repo->new_object('Article');
$article_en->Title = 'Dimensiones';
$article_en->set_dimension([$es]);
$article_en->approve();