Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

ezisbngroup.php
Go to the documentation of this file.
1 <?php
23 class eZISBNGroup extends eZPersistentObject
24 {
29 static function definition()
30 {
31 return array( 'fields' => array( 'id' => array( 'name' => 'ID',
32 'datatype' => 'integer',
33 'default' => 0,
34 'required' => true ),
35 'description' => array( 'name' => 'Description',
36 'datatype' => 'string',
37 'default' => '',
38 'required' => false ),
39 'group_number' => array( 'name' => 'GroupNumber',
40 'datatype' => 'integer',
41 'default' => 0,
42 'required' => true ),
43 ),
44 'keys' => array( 'id' ),
45 'increment_key' => 'id',
46 'class_name' => 'eZISBNGroup',
47 'name' => 'ezisbn_group' );
48 }
49
57 static function create( $groupNumber, $description = "" )
58 {
59 $row = array( 'id' => null,
60 'description' => $description,
61 'group_number' => $groupNumber );
62 return new eZISBNGroup( $row );
63 }
64
65
71 static function removeByID( $id )
72 {
73 eZPersistentObject::removeObject( eZISBNGroup::definition(),
74 array( 'id' => $id ) );
75 }
76
82 static function fetchList( $asObject = true )
83 {
84 $sortArray = array( 'id' => 'asc' );
85 return eZPersistentObject::fetchObjectList( eZISBNGroup::definition(),
86 null, null, $sortArray, null,
87 $asObject );
88 }
89
96 static function fetchByGroup( $groupNumber, $asObject = true )
97 {
98 $conditions = array( 'group_number' => $groupNumber );
99 $group = false;
100 $groupArray = eZPersistentObject::fetchObjectList( eZISBNGroup::definition(),
101 null, $conditions, null, null,
102 $asObject );
103 if ( count( $groupArray ) == 1 )
104 {
105 $group = $groupArray[0];
106 }
107 return $group;
108 }
109
114 static function cleanAll()
115 {
116 $db = eZDB::instance();
117 $definition = eZISBNGroup::definition();
118 $table = $definition['name'];
119 if ( $db->DatabaseName() == 'sqlite' )
120 $sql = "DELETE FROM " . $table;
121 else
122 {
123 $sql = "TRUNCATE TABLE " . $table;
124 }
125 $db->query( $sql );
126 }
127 }
128
129 ?>
eZDB\instance
static instance( $databaseImplementation=false, $databaseParameters=false, $forceNewInstance=false)
Definition: ezdb.php:117
eZISBNGroup
The class eZISBNGroup handles ISBN Registration groups.
Definition: ezisbngroup.php:24
eZISBNGroup\cleanAll
static cleanAll()
Definition: ezisbngroup.php:114
eZISBNGroup\create
static create( $groupNumber, $description="")
Definition: ezisbngroup.php:57
eZISBNGroup\removeByID
static removeByID( $id)
Definition: ezisbngroup.php:71
eZISBNGroup\fetchList
static fetchList( $asObject=true)
Definition: ezisbngroup.php:82
eZISBNGroup\definition
static definition()
Definition: ezisbngroup.php:29
eZISBNGroup\fetchByGroup
static fetchByGroup( $groupNumber, $asObject=true)
Definition: ezisbngroup.php:96
eZPersistentObject
Definition: ezpersistentobject.php:33
eZPersistentObject\removeObject
static removeObject( $def, $conditions=null, $extraConditions=null)
Definition: ezpersistentobject.php:271
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+.