Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezcontentclassname.php
Go to the documentation of this file.
1 <?php
11 class eZContentClassName extends eZPersistentObject
12 {
13 static function definition()
14 {
15 return array( 'fields' => array( 'contentclass_id' => array( 'name' => 'ContentClassID',
16 'datatype' => 'integer',
17 'default' => 0,
18 'required' => true,
19 'foreign_class' => 'eZContentClass',
20 'foreign_attribute' => 'id',
21 'multiplicity' => '1..*' ),
22 'contentclass_version' => array( 'name' => 'ContentClassVersion',
23 'datatype' => 'integer',
24 'default' => 0,
25 'required' => true ),
26 'language_locale' => array( 'name' => 'LanguageLocale',
27 'datatype' => 'string',
28 'default' => '',
29 'required' => true ),
30 'language_id' => array( 'name' => 'LanguageID',
31 'datatype' => 'integer',
32 'default' => 0,
33 'required' => true,
34 'foreign_class' => 'eZContentLanguage',
35 'foreign_attribute' => 'id',
36 'multiplicity' => '1..*' ),
37 'name' => array( 'name' => 'Name',
38 'datatype' => 'string',
39 'default' => '',
40 'required' => false ) ),
41 'keys' => array( 'contentclass_id',
42 'contentclass_version',
43 'language_locale' ),
44 'function_attributes' => array(),
45 'class_name' => 'eZContentClassName',
46 'sort' => array( 'contentclass_id' => 'asc' ),
47 'name' => 'ezcontentclass_name' );
48 }
49
50 static function fetchList( $classID, $classVersion, $languageLocaleList, $asObjects = true, $fields = null, $sorts = null, $limit = null )
51 {
52 $conds = array();
53
54 if ( is_array( $languageLocaleList ) && count( $languageLocaleList ) > 0 )
55 $conds[ 'language_locale'] = array( $languageLocaleList );
56
57 $conds[ 'contentclass_id'] = $classID;
58 $conds[ 'contentclass_version'] = $classVersion;
59
60 return eZPersistentObject::fetchObjectList( eZContentClassName::definition(),
61 $fields,
62 $conds,
63 $sorts,
64 $limit,
65 $asObjects );
66 }
67
75 static function sqlFilter( $languageTable = 'ezcontentclass' )
76 {
77 $def = eZContentClassName::definition();
78 $languageListTable = $def['name'];
79 $sqlFilter = array( 'nameField' => "$languageListTable.name",
80 'from' => "$languageListTable",
81 'where' => "$languageTable.id = $languageListTable.contentclass_id AND
82 $languageTable.version = $languageListTable.contentclass_version AND " .
83 eZContentLanguage::sqlFilter( $languageListTable, $languageTable ),
84 'orderBy' => "$languageListTable.name" );
85
86 return $sqlFilter;
87 }
88
92 static function sqlAppendFilter( $languageTable = 'ezcontentclass' )
93 {
94 $def = eZContentClassName::definition();
95 $languageListTable = $def['name'];
96 $sqlFilter = array( 'nameField' => ", $languageListTable.name",
97 'from' => ", $languageListTable",
98 'where' => "AND $languageTable.id = $languageListTable.contentclass_id AND
99 $languageTable.version = $languageListTable.contentclass_version AND " .
100 eZContentLanguage::sqlFilter( $languageListTable, $languageTable ),
101 'orderBy' => "$languageListTable.name" );
102
103 return $sqlFilter;
104 }
105
109 static function sqlEmptyFilter()
110 {
111 return array( 'nameField' => '',
112 'from' => '',
113 'where' => '',
114 'orderBy' => '' );
115 }
116
117 static function removeClassName( $contentClassID, $contentClassVersion )
118 {
119 $db = eZDB::instance();
120 $db->begin();
121
122 $sql = "DELETE FROM ezcontentclass_name WHERE contentclass_id = $contentClassID AND contentclass_version = $contentClassVersion";
123 $db->query( $sql );
124
125 $db->commit();
126 }
127
128 }
129
130 ?>
eZContentClassName
Definition: ezcontentclassname.php:12
eZContentClassName\definition
static definition()
Definition: ezcontentclassname.php:13
eZContentClassName\sqlFilter
static sqlFilter( $languageTable='ezcontentclass')
Definition: ezcontentclassname.php:75
eZContentClassName\fetchList
static fetchList( $classID, $classVersion, $languageLocaleList, $asObjects=true, $fields=null, $sorts=null, $limit=null)
Definition: ezcontentclassname.php:50
eZContentClassName\sqlEmptyFilter
static sqlEmptyFilter()
Definition: ezcontentclassname.php:109
eZContentClassName\removeClassName
static removeClassName( $contentClassID, $contentClassVersion)
Definition: ezcontentclassname.php:117
eZContentClassName\sqlAppendFilter
static sqlAppendFilter( $languageTable='ezcontentclass')
Definition: ezcontentclassname.php:92
eZContentLanguage\sqlFilter
static sqlFilter( $languageTable, $languageListTable=null, $languageAttributeName='language_id', $languageListAttributeName='language_mask', $lang=false)
Definition: ezcontentlanguage.php:692
eZDB\instance
static instance( $databaseImplementation=false, $databaseParameters=false, $forceNewInstance=false)
Definition: ezdb.php:117
eZPersistentObject
Definition: ezpersistentobject.php:33
eZPersistentObject\count
static count( $def, $conds=null, $field=null)
Definition: ezpersistentobject.php:187
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:806
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.