Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezcontentobjectstatelanguage.php
Go to the documentation of this file.
1 <?php
21 class eZContentObjectStateLanguage extends eZPersistentObject
22 {
23 public $Description;
24 public $LanguageID;
25 static function definition()
26 {
27 static $definition = array( "fields" => array( "contentobject_state_id" => array( "name" => "ContentObjectStateID",
28 "datatype" => "integer",
29 "required" => true,
30 "foreign_class" => "eZContentObjectState",
31 "foreign_attribute" => "id",
32 "multiplicity" => "1..*" ),
33 "language_id" => array( "name" => "LanguageID",
34 "datatype" => "integer",
35 "required" => true ),
36 "name" => array( "name" => "Name",
37 "datatype" => "string",
38 "required" => true ),
39 "description" => array( "name" => "Description",
40 "datatype" => "text",
41 "required" => false ) ),
42 "keys" => array( "contentobject_state_id",
43 "language_id" ),
44 "function_attributes" => array( "language" => "language",
45 "is_valid" => "isValid",
46 "real_language_id" => "realLanguageID",
47 ),
48 "increment_key" => false,
49 "class_name" => "eZContentObjectStateLanguage",
50 "sort" => array(),
51 "name" => "ezcobj_state_language" );
52 return $definition;
53 }
54
61 public static function fetchByState( $id )
62 {
63 return eZPersistentObject::fetchObjectList( eZContentObjectStateLanguage::definition(), null, array( 'contentobject_state_id' => $id ) );
64 }
65
72 public function isValid( &$messages = array() )
73 {
74 $isValid = true;
75 if ( isset( $this->Name ) && strlen( $this->Name ) > 45 )
76 {
77 $messages[] = ezpI18n::tr( 'kernel/state/edit', 'Name in %language_name is too long. Maximum 45 characters allowed.', null, array( '%language_name' => $this->language()->attribute( 'locale_object' )->attribute( 'intl_language_name' ) ) );
78 $isValid = false;
79 }
80
81 if ( ( !isset( $this->Name ) || $this->Name == '' ) && $this->Description != '' )
82 {
83 $messages[] = ezpI18n::tr( 'kernel/state/edit', 'Name in %language_name: input required', null, array( '%language_name' => $this->language()->attribute( 'locale_object' )->attribute( 'intl_language_name' ) ) );
84 $isValid = false;
85 }
86
87 return $isValid;
88 }
89
95 public function language()
96 {
97 return eZContentLanguage::fetch( $this->LanguageID & ~1 );
98 }
99
105 public function hasData()
106 {
107 return ( isset( $this->Name) && trim( $this->Name ) != '' ) || ( isset( $this->Description ) && trim( $this->Description ) != '' );
108 }
109
115 public function realLanguageID()
116 {
117 return $this->LanguageID & ~1;
118 }
119 }
120 ?>
eZContentLanguage\fetch
static fetch( $id)
Definition: ezcontentlanguage.php:252
eZContentObjectStateLanguage
Definition: ezcontentobjectstatelanguage.php:22
eZContentObjectStateLanguage\$LanguageID
$LanguageID
Definition: ezcontentobjectstatelanguage.php:24
eZContentObjectStateLanguage\hasData
hasData()
Definition: ezcontentobjectstatelanguage.php:105
eZContentObjectStateLanguage\isValid
isValid(&$messages=array())
Definition: ezcontentobjectstatelanguage.php:72
eZContentObjectStateLanguage\definition
static definition()
Definition: ezcontentobjectstatelanguage.php:25
eZContentObjectStateLanguage\realLanguageID
realLanguageID()
Definition: ezcontentobjectstatelanguage.php:115
eZContentObjectStateLanguage\fetchByState
static fetchByState( $id)
Definition: ezcontentobjectstatelanguage.php:61
eZContentObjectStateLanguage\$Description
$Description
Definition: ezcontentobjectstatelanguage.php:23
eZContentObjectStateLanguage\language
language()
Definition: ezcontentobjectstatelanguage.php:95
eZPersistentObject
Definition: ezpersistentobject.php:34
eZPersistentObject\attribute
attribute( $attr, $noFunction=false)
Definition: ezpersistentobject.php:1330
eZPersistentObject\fetchObjectList
static fetchObjectList( $def, $field_filters=null, $conds=null, $sorts=null, $limit=null, $asObject=true, $grouping=false, $custom_fields=null, $custom_tables=null, $custom_conds=null)
Definition: ezpersistentobject.php:807
$id
$id
Definition: companytypelist.php:193
$messages
$messages
Definition: homepage.php:328
Name
if($user) if(isset( $next) && $next)<?=isset($all_fields_error) &&$all_fields_error ?><?=isset($password_error) &&$password_error ?></p ><? endif;?>< form method="post">< table border="0" cellspacing="2" cellpadding="2" class="boxtext" style="font-size=13;">< tr >< td style="color:<?= isset( $error['first_name'] ) ?> First Name
Definition: step1.php:127
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.