Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezproductcategory.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: ezproductcategory.php 9895 2004-04-06 11:08:44Z br $
5 //
6 // Definition of eZProductCategory class
7 //
8 // Created on: <11-Sep-2000 22:10:06 bf>
9 //
10 // This source file is part of Exponential Basic, publishing software.
11 //
12 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
13 //
14 // This program is free software; you can redistribute it and/or
15 // modify it under the terms of the GNU General Public License
16 // as published by the Free Software Foundation; either version 2
17 // of the License, or (at your option) any later version.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
27 //
28
31
86 // include_once( "classes/ezdb.php" );
87 // include_once( "eztrade/classes/ezproduct.php" );
88
89 class eZProductCategory
90 {
97 function __construct( $id = -1 )
98 {
99 $this->ImageID = 0;
100 $this->Parent = 0;
101 $this->ID = 0;
102
103 if ( $id != -1 )
104 {
105 $this->ID = $id;
106 $this->get( $this->ID );
107 }
108 }
109
113 function store()
114 {
115 $db =& eZDB::globalDatabase();
116 $db->begin();
117
118 $name = $db->escapeString( $this->Name );
119 $description = $db->escapeString( $this->Description );
120 $remoteID = $db->escapeString( $this->RemoteID );
121
122 if( $this->Parent == null )
123 $this->Parent = 0;
124
125 if ( $this->ID == false )
126 {
127
128 $db->lock( "eZTrade_Category" );
129 $nextID = $db->nextID( "eZTrade_Category", "ID" );
130 $query = "INSERT INTO eZTrade_Category
131 ( ID, Name, Description, SortMode, RemoteID, ImageID, SectionID, Parent )
132 VALUES
133 ( '$nextID',
134 '$name',
135 '$description',
136 '$this->SortMode',
137 '$remoteID',
138 '$this->ImageID',
139 '$this->SectionID',
140 '$this->Parent' ) ";
141
142 $res = $db->query( $query );
143
144 $db->unlock();
145 $this->ID = $nextID;
146 }
147 else
148 {
149 $query = "UPDATE eZTrade_Category SET
150 Name='$name',
151 Description='$description',
152 SortMode='$this->SortMode',
153 RemoteID='$this->RemoteID',
154 ImageID='$this->ImageID',
155 SectionID='$this->SectionID',
156 Parent='$this->Parent' WHERE ID='$this->ID'";
157 $res = $db->query( $query );
158 }
159
160 if ( $res == false )
161 $db->rollback( );
162 else
163 $db->commit();
164
165 return true;
166 }
167
172 function delete( $catID=-1 )
173 {
174 $db =& eZDB::globalDatabase();
175
176 if ( $catID == -1 )
177 $catID = $this->ID;
178
179 $category = new eZProductCategory( $catID );
180
181 $categoryList = $category->getByParent( $category );
182
183 foreach ( $categoryList as $categoryItem )
184 {
185 $this->delete( $categoryItem->id() );
186 }
187
188 $categoryID = $category->id();
189
190 foreach( $this->products() as $product )
191 {
192 $categoryDefinition = $product->categoryDefinition();
193
194 if ( $categoryDefinition->id() == $category->id() )
195 {
196 $db->query( "DELETE FROM eZTrade__ProductCategoryDefinition WHERE CategoryID='$categoryID'" );
197 $db->query( "DELETE FROM eZTrade_ProductCategoryLink WHERE CategoryID='$categoryID'" );
198
199 $product->delete();
200 }
201 else
202 {
203 $db->query( "DELETE FROM eZTrade_ProductCategoryLink WHERE CategoryID='$categoryID'" );
204 }
205 }
206
207 $db->query( "DELETE FROM eZTrade_Category WHERE ID='$categoryID'" );
208 }
209
213 function get( $id=-1 )
214 {
215 $db =& eZDB::globalDatabase();
216 $category_array = array();
217 $ret = false;
218
219 if ( $id != "" && $id != -1 )
220 {
221 $query = "SELECT * FROM eZTrade_Category WHERE ID='$id'";
222 $db->array_query( $category_array, $query );
223
224 if ( count( $category_array ) > 1 )
225 {
226 die( "Error: Category's with the same ID was found in the database. This should not happen." );
227 }
228 else if ( count( $category_array ) == 1 )
229 {
230 $this->ID =& $category_array[0][$db->fieldName( "ID" )];
231 $this->Name =& $category_array[0][$db->fieldName( "Name" )];
232 $this->Description =& $category_array[0][$db->fieldName( "Description" )];
233 if( $category_array[0][$db->fieldName( "Parent" )] != NULL )
234 $this->Parent =& $category_array[0][$db->fieldName( "Parent" )];
235 $this->SortMode =& $category_array[0][$db->fieldName( "SortMode" )];
236 $this->RemoteID =& $category_array[0][$db->fieldName( "RemoteID" )];
237 $this->ImageID =& $category_array[0][$db->fieldName( "ImageID" )];
238 $this->SectionID =& $category_array[0][$db->fieldName( "SectionID" )];
239 $ret = true;
240 }
241 }
242 return $ret;
243 }
244
250 function &getAll()
251 {
252 $db =& eZDB::globalDatabase();
253
254 $return_array = array();
255 $category_array = array();
256
257 $db->array_query( $category_array, "SELECT ID FROM eZTrade_Category ORDER BY Name" );
258
259 for ( $i=0; $i < count($category_array); $i++ )
260 {
261 $return_array[$i] = new eZProductCategory( $category_array[$i][$db->fieldName( "ID" )], 0 );
262 }
263
264 return $return_array;
265 }
266
272 function &getByParent( $parent, $sortby='name' )
273 {
274 if ( is_a( $parent, "eZProductCategory" ) )
275 {
276 $db =& eZDB::globalDatabase();
277
278 $return_array = array();
279 $category_array = array();
280
281 $parentID = $parent->id();
282 $query = "SELECT ID, Name FROM eZTrade_Category WHERE Parent='$parentID';";
283 $db->array_query( $category_array, $query );
284
285 for ( $i = 0; $i < count( $category_array ); $i++ )
286 {
287 $return_array[$i] = new eZProductCategory( $category_array[$i][$db->fieldName( "ID" )], 0 );
288 }
289
290 return $return_array;
291 }
292 else
293 {
294 return 0;
295 }
296 }
297
305 function &path( $categoryID=0 )
306 {
307 if ( $categoryID == 0 )
308 {
309 $categoryID = $this->ID;
310 }
311
312 $category = new eZProductCategory( $categoryID );
313
314 $path = array();
315
316 $parent = $category->parent();
317 if ( $parent != 0 )
318 {
319 $path = array_merge( $path, $this->path( $parent->id() ) );
320 }
321 else
322 {
323 // array_push( $path, $category->name() );
324 }
325
326 if ( $categoryID != 0 )
327 array_push( $path, array( $category->id(), $category->name() ) );
328
329 return $path;
330 }
331
335 static public function &getTree( $parentID=0, $level=0 )
336 {
337 $category = new eZProductCategory( $parentID );
338
339 $categoryList = $category->getByParent( $category, true );
340
341 $tree = array();
342 $level++;
343 foreach ( $categoryList as $category )
344 {
345 array_push( $tree, array( $return_array[] = new eZProductCategory( $category->id() ), $level ) );
346 if ( $category != 0 )
347 {
348 $tree = array_merge( $tree, eZProductCategory::getTree( $category->id(), $level ) );
349 }
350 }
351 return $tree;
352 }
353
354
358 function id()
359 {
360 $ret = $this->ID;
361 return $ret;
362 }
363
364
368 function &name()
369 {
370 $ret = stripslashes( $this->Name );
371 return htmlspecialchars( $ret );
372 }
373
377 function remoteID()
378 {
379 return $this->RemoteID;
380 }
381
385 function sectionID()
386 {
387 return $this->SectionID;
388 }
389
394 static public function sectionIDStatic( $categoryID )
395 {
396 $db =& eZDB::globalDatabase();
397 $db->query_single( $res, "SELECT SectionID from eZTrade_Category WHERE ID='$categoryID'");
398
399 if ( is_array( $res ) )
400 $sectionID = $res[$db->fieldName("SectionID")];
401 else
402 $sectionID = 0;
403
404 if ( $sectionID > 0 )
405 return $sectionID;
406 else
407 return false;
408 }
409
413 function &description()
414 {
415 if( $this->Description != null )
416 $description = stripslashes( $this->Description );
417 else
418 return false;
419
420 return htmlspecialchars( $description );
421 }
422
426 function &parent()
427 {
428 if ( is_a($this->Parent, 'eZProductCategory'))
429 {
430 return new eZProductCategory( $this->Parent );
431 }
432 else
433 {
434 return null;
435 }
436 }
437
446 function &sortMode()
447 {
448 switch( $this->SortMode )
449 {
450 case 1 :
451 {
452 $SortMode = "time";
453 }
454 break;
455
456 case 2 :
457 {
458 $SortMode = "alpha";
459 }
460 break;
461
462 case 3 :
463 {
464 $SortMode = "alphadesc";
465 }
466 break;
467
468 case 4 :
469 {
470 $SortMode = "absolute_placement";
471 }
472 break;
473
474 default :
475 {
476 $SortMode = "time";
477 }
478 }
479
480 return $SortMode;
481 }
482
486 function setName( &$value )
487 {
488 $this->Name = $value;
489 }
490
494 function setRemoteID( &$value )
495 {
496 $this->RemoteID = $value;
497 }
498
502 function setSectionID( &$value )
503 {
504 $this->SectionID = $value;
505 }
506
510 function setDescription( &$value )
511 {
512 $this->Description = $value;
513 }
514
518 function setParent( $parent )
519 {
520 if ( is_a( $parent, "eZProductCategory" ) )
521 {
522 $this->Parent = $parent->id();
523 }
524 else
525 {
526 $this->Parent = $parent;
527 }
528 }
529
538 function setSortMode( $value )
539 {
540 $this->SortMode = $value;
541 }
542
548 static public function addProduct( &$value, $categoryid = false )
549 {
550 if ( is_a( $value, "eZProduct" ) )
551 $prodID = $value->id();
552 else if ( is_numeric( $value ) )
553 $prodID = $value;
554 else
555 return false;
556
557 if ( !$categoryid )
558 $categoryid = 1;
559
560 $db =& eZDB::globalDatabase();
561
562 $db->array_query( $qry, "SELECT Placement FROM eZTrade_ProductCategoryLink
563 ORDER BY Placement DESC", array( "Limit" => 1 ) );
564
565 $placement = count( $qry ) == 1 ? $qry[0][$db->fieldName( "Placement" )] + 1 : 1;
566
567 $db->begin();
568 $db->lock( "eZTrade_ProductCategoryLink" );
569 $nextID = $db->nextID( "eZTrade_ProductCategoryLink", "ID" );
570
571 $query = ( "INSERT INTO eZTrade_ProductCategoryLink
572 (ID, CategoryID, ProductID, Placement)
573 VALUES ('$nextID', '$categoryid', '$prodID', '$placement')" );
574
575 $res = $db->query( $query );
576 $db->unlock();
577
578 if ( $res == false )
579 $db->rollback( );
580 else
581 $db->commit();
582 }
583
589 static public function removeProduct( &$value, $categoryid = false )
590 {
591 if ( is_a( $value, "eZProduct" ) )
592 $prodID = $value->id();
593 else if ( is_numeric( $value ) )
594 $prodID = $value;
595 else
596 return false;
597
598 if ( !$categoryid )
599 $categoryid = $this->ID;
600
601 $db =& eZDB::globalDatabase();
602 $db->begin();
603
604 $query = "DELETE FROM eZTrade_ProductCategoryLink
605 WHERE CategoryID='$categoryid' AND
606 ProductID='$prodID'";
607 $res = $db->query( $query );
608
609 if ( $res == false )
610 $db->rollback( );
611 else
612 $db->commit();
613 }
614
618 function productCount( $sortMode="time",
619 $fetchNonActive=false,
620 $fetchDiscontinued=false,
621 $categoryID=false)
622 {
623 $db =& eZDB::globalDatabase();
624
625 if ( $categoryID != false )
626 $catID = $categoryID;
627 else
628 $catID = $this->ID;
629
630 switch ( $sortMode )
631 {
632 case "time" :
633 {
634 $OrderBy = "eZTrade_Product.Published DESC";
635 }
636 break;
637
638 case "alpha" :
639 {
640 $OrderBy = "eZTrade_Product.Name ASC";
641 }
642 break;
643
644 case "alphadesc" :
645 {
646 $OrderBy = "eZTrade_Product.Name DESC";
647 }
648 break;
649
650 case "absolute_placement" :
651 {
652 $OrderBy = "eZTrade_ProductCategoryLink.Placement ASC";
653 }
654 break;
655
656 default :
657 {
658 $OrderBy = "eZTrade_Product.Published DESC";
659 }
660 }
661
662 $permissionSQLArray = eZProductCategory::generatePermissionSQL( $catID);
663 $permissionTableSQL = $permissionSQLArray["TableSQL"];
664 $permissionSQL = $permissionSQLArray["SQL"];
665
666
667 $nonActiveCode = $fetchNonActive ? "" : " eZTrade_Product.ShowProduct='1' AND";
668 $discontinuedCode = "";
669 if ( !$fetchDiscontinued )
670 $discontinuedCode = " eZTrade_Product.Discontinued='0' AND";
671 $query = "SELECT COUNT( DISTINCT eZTrade_Product.ID ) AS Count
672 FROM eZTrade_Product, eZTrade_ProductCategoryLink $permissionTableSQL
673 WHERE
674 eZTrade_ProductCategoryLink.ProductID = eZTrade_Product.ID
675 AND
676 $nonActiveCode
677 $discontinuedCode
678 $permissionSQL
679 eZTrade_ProductCategoryLink.CategoryID='$catID'";
680
681 $db->query_single( $products, $query );
682 return $products[$db->fieldName( "Count" )];
683 }
684
688 static public function &products( $sortMode="time",
689 $fetchNonActive=false,
690 $offset=0,
691 $limit=50,
692 $fetchDiscontinued=false,
693 $categoryID=0 )
694 {
695 if ( $categoryID != -1 )
696 $catID = $categoryID;
697 else
698 $catID = $this->ID;
699
700 $db =& eZDB::globalDatabase();
701
702 switch( $sortMode )
703 {
704 case "time" :
705 {
706 $OrderBy = "eZTrade_Product.Published DESC";
707 }
708 break;
709
710 case "alphanumeric_asc" :
711 case "alpha" :
712 {
713 $OrderBy = "eZTrade_Product.Name ASC";
714 }
715 break;
716
717 case "alphadesc" :
718 {
719 $OrderBy = "eZTrade_Product.Name DESC";
720 }
721 break;
722
723 case "absolute_placement" :
724 {
725 $OrderBy = "eZTrade_ProductCategoryLink.Placement ASC";
726 }
727 break;
728
729 default :
730 {
731 $OrderBy = "eZTrade_Product.Published DESC";
732 }
733 }
734
735 $return_array = array();
736 $product_array = array();
737
738 $permissionSQLArray = eZProductCategory::generatePermissionSQL( $catID );
739 $permissionTableSQL = $permissionSQLArray["TableSQL"];
740 $permissionSQL = $permissionSQLArray["SQL"];
741
742 $user =& eZUser::currentUser();
743 if ( $user )
744 {
745 $groups = $user->groups();
746 }
747 else
748 {
749 $groups = array();
750 }
751
752 if ( $fetchNonActive == true )
753 {
754 $nonActiveCode = "";
755 }
756 else
757 {
758 $nonActiveCode = " eZTrade_Product.ShowProduct='1' AND";
759 }
760 $discontinuedCode = "";
761
762 if ( !$fetchDiscontinued )
763 $discontinuedCode = " eZTrade_Product.Discontinued='0' AND";
764
765 $query = "SELECT DISTINCT eZTrade_Product.ID AS ProductID, eZTrade_Product.Name,
766 eZTrade_Category.ID, eZTrade_Category.Name
767 FROM eZTrade_Product, eZTrade_Category,
768 eZTrade_ProductCategoryLink $permissionTableSQL
769 WHERE
770 eZTrade_ProductCategoryLink.ProductID = eZTrade_Product.ID
771 AND
772 $nonActiveCode
773 $discontinuedCode
774 $permissionSQL
775 eZTrade_Category.ID = eZTrade_ProductCategoryLink.CategoryID
776 AND
777 eZTrade_Category.ID='$catID'
778 ORDER BY $OrderBy";
779
780 $db->array_query( $product_array, $query, array( "Limit" => $limit, "Offset" => $offset ) );
781
782 for ( $i = 0; $i < count( $product_array ); $i++ )
783 {
784 $return_array[$i] = new eZProduct( $product_array[$i][$db->fieldName( "ProductID" )], false );
785 }
786 return $return_array;
787 }
788
789 static public function generatePermissionSQL( $categoryID = false )
790 {
791 $catID = $categoryID;
792
793 $user =& eZUser::currentUser();
794 $hasRootAccess = false;
795 if ( $user )
796 {
797 $groups = $user->groups();
798 $hasRootAccess = $user->hasRootAccess();
799 }
800 else
801 {
802 $groups = array();
803 }
804 $permission = array( 'SQL' => '', 'TableSQL' => '');
805 if ( $hasRootAccess == false )
806 {
807
808 $productGroupSQL = " (PP.GroupID='-1'";
809 $categoryGroupSQL = " AND (PCP.GroupID='-1'";
810 if ( $user )
811 {
812 $groups =& $user->groups( false );
813 $first = true;
814
815 foreach ( $groups as $group )
816 {
817 $productGroupSQL .= " OR PP.GroupID='$group'";
818 $categoryGroupSQL .= " OR PCP.GroupID='$group'";
819 }
820
821 if ( $user->hasRootAccess() )
822 $usePermission = false;
823 }
824 $productGroupSQL .= ") AND PP.ReadPermission='1'";
825 $categoryGroupSQL .= ") AND PCP.ReadPermission='1'";
826
827 if ( is_numeric( $catID ) && $catID > 0 )
828 {
829 $permission["SQL"] = "$productGroupSQL $categoryGroupSQL AND PP.ObjectID=eZTrade_Product.ID AND PCP.ObjectID='$catID' AND";
830 $permission["TableSQL"] = ", eZTrade_ProductPermission as PP, eZTrade_CategoryPermission as PCP";
831 }
832 else
833 {
834 $permission["SQL"] = "$productGroupSQL AND PP.ObjectID=eZTrade_Product.ID AND";
835 $permission["TableSQL"] = ", eZTrade_ProductPermission as PP";
836 }
837 }
838 return $permission;
839 }
840
841
845 function &activeProducts( $sortMode="time",
846 $offset=0,
847 $limit=50,
848 $categoryID=false )
849 {
850 return $this->products( $sortMode, false, $offset, $limit, false, $categoryID );
851 }
852
853
857 function addOption( $value )
858 {
859 if ( is_a( $value, "eZOption" ) )
860 {
861 $db =& eZDB::globalDatabase();
862 $db->begin();
863
864 $optionID = $value->id();
865 $value->store();
866
867 $db->lock( "eZTrade_CategoryOptionLink" );
868 $nextID = $db->nextID( "eZTrade_CategoryOptionLink", "ID" );
869
870 $res = $db->query( "INSERT INTO eZTrade_CategoryOptionLink
871 ( ID, CategoryID, OptionID )
872 VALUES
873 ( '$nextID',
874 '$this->ID',
875 '$optionID' )
876 " );
877 $db->unlock();
878
879 if ( $res == false )
880 $db->rollback( );
881 else
882 $db->commit();
883 }
884 }
885
889 function &options()
890 {
891 $db =& eZDB::globalDatabase();
892
893 $return_array = array();
894 $option_array = array();
895
896 $db->array_query( $option_array, "SELECT OptionID FROM eZTrade_CategoryOptionLink WHERE CategoryID='$this->ID'" );
897
898 for ( $i=0; $i < count($option_array); $i++ )
899 {
900 $return_array[$i] = new eZOption( $option_array[$i][$db->fieldName( "OptionID" )], false );
901 }
902
903 return $return_array;
904 }
905
909 function moveUp( $id )
910 {
911 $db =& eZDB::globalDatabase();
912
913 $db->query_single( $qry, "SELECT * FROM eZTrade_ProductCategoryLink
914 WHERE ProductID='$id' AND CategoryID='$this->ID'" );
915
916 if ( is_numeric( $qry[$db->fieldName( "ID" )] ) )
917 {
918 $linkID = $qry[$db->fieldName( "ID" )];
919
920 $placement = $qry[$db->fieldName( "Placement" )];
921
922 $db->query_single( $qry, "SELECT ID, Placement FROM eZTrade_ProductCategoryLink
923 WHERE Placement<'$placement' AND
924 eZTrade_ProductCategoryLink.CategoryID='$this->ID'
925 ORDER BY Placement DESC", array( "Limit" => 1 ) );
926
927 $newPlacement = $qry[$db->fieldName( "Placement" )];
928 $listid = $qry[$db->fieldName( "ID" )];
929
930 if ( is_numeric( $listid ) )
931 {
932 $db->begin();
933 $res[] = $db->query( "UPDATE eZTrade_ProductCategoryLink SET Placement='$placement' WHERE ID='$listid'" );
934 $res[] = $db->query( "UPDATE eZTrade_ProductCategoryLink SET Placement='$newPlacement' WHERE ID='$linkID'" );
935 if ( in_array( false, $res ) )
936 $db->rollback( );
937 else
938 $db->commit();
939 }
940 }
941 }
942
946 function moveDown( $id )
947 {
948 $db =& eZDB::globalDatabase();
949
950 $db->query_single( $qry, "SELECT * FROM eZTrade_ProductCategoryLink
951 WHERE ProductID='$id' AND CategoryID='$this->ID'" );
952
953 if ( is_numeric( $qry[$db->fieldName( "ID" )] ) )
954 {
955 $linkID = $qry[$db->fieldName( "ID" )];
956
957 $placement = $qry[$db->fieldName( "Placement" )];
958
959 $db->query_single( $qry_2, "SELECT ID, Placement FROM eZTrade_ProductCategoryLink
960 WHERE Placement>'$placement' AND eZTrade_ProductCategoryLink.CategoryID='$this->ID' ORDER BY Placement ASC", array( "Limit" => 1 ) );
961
962 $newPlacement = $qry_2[$db->fieldName("Placement" )];
963 $listid = $qry_2[$db->fieldName("ID" )];
964
965 if ( is_numeric( $listid ) )
966 {
967 $db->begin();
968 $res[] = $db->query( "UPDATE eZTrade_ProductCategoryLink SET Placement='$placement' WHERE ID='$listid'" );
969 $res[] = $db->query( "UPDATE eZTrade_ProductCategoryLink SET Placement='$newPlacement' WHERE ID='$linkID'" );
970 if ( in_array( false, $res ) )
971 $db->rollback( );
972 else
973 $db->commit();
974 }
975 }
976 }
977
978
982 function getByRemoteID( $id, $parent=false )
983 {
984 $db =& eZDB::globalDatabase();
985
986 $category = false;
987
988 if ( $parent )
989 {
990 $db->array_query( $res, "SELECT ID FROM
991 eZTrade_Category
992 WHERE Parent='$parent' AND RemoteID='$id'" );
993
994 }
995 else
996 {
997 $db->array_query( $res, "SELECT ID FROM
998 eZTrade_Category
999 WHERE RemoteID='$id'" );
1000
1001 }
1002
1003 if ( count( $res ) == 1 )
1004 {
1005 $category = new eZProductCategory( $res[0][$db->fieldName( "ID" )] );
1006 }
1007
1008 return $category;
1009 }
1010
1014 function cloneObject( )
1015 {
1016 if ( is_object ( $this ) )
1017 {
1018 $clone = $this;
1019 $clone->ID = false;
1020 return $clone;
1021 }
1022 else
1023 return false;
1024 }
1025
1026
1030 function copy( $recursive=true, $id=false )
1031 {
1032 }
1033
1037 function setImage( $value )
1038 {
1039 if ( is_a( $value, "eZImage" ) )
1040 $value = $value->id();
1041
1042 $this->ImageID = $value;
1043 }
1044
1048 function &image( $AsObject = true )
1049 {
1050 if ( $AsObject )
1051 $image = new eZImage( $this->ImageID );
1052 else
1053 $image = $this->ImageID;
1054
1055 return $image;
1056 }
1057
1058 var $ID;
1059 var $Name;
1060 var $Parent;
1061 var $Description;
1062 var $OptionArray;
1063 var $SortMode;
1064 var $RemoteID;
1065 var $ImageID;
1066 var $SectionID;
1067 }
1068
1069 ?>
$category
if( $Action=="Edit") $category
Definition: adedit.php:378
$i
$i
Definition: admin/adlist.php:91
$categoryList
foreach( $pathArray as $path) $categoryList
Definition: admin/adlist.php:86
$group
$group
Definition: admin/articleedit.php:799
$level
$level
Definition: admin/message.php:106
eZDB\globalDatabase
static & globalDatabase()
Definition: ezdb.php:134
eZImage
Definition: ezimage.php:95
eZOption
Definition: ezoption.php:82
eZProductCategory
Definition: ezproductcategory.php:90
eZProductCategory\name
& name()
Definition: ezproductcategory.php:368
eZProductCategory\remoteID
remoteID()
Definition: ezproductcategory.php:377
eZProductCategory\removeProduct
static removeProduct(&$value, $categoryid=false)
Definition: ezproductcategory.php:589
eZProductCategory\sectionID
sectionID()
Definition: ezproductcategory.php:385
eZProductCategory\productCount
productCount( $sortMode="time", $fetchNonActive=false, $fetchDiscontinued=false, $categoryID=false)
Definition: ezproductcategory.php:618
eZProductCategory\$SortMode
$SortMode
Definition: ezproductcategory.php:1063
eZProductCategory\setName
setName(&$value)
Definition: ezproductcategory.php:486
eZProductCategory\cloneObject
cloneObject()
Definition: ezproductcategory.php:1014
eZProductCategory\__construct
__construct( $id=-1)
Definition: ezproductcategory.php:97
eZProductCategory\$Name
$Name
Definition: ezproductcategory.php:1059
eZProductCategory\generatePermissionSQL
static generatePermissionSQL( $categoryID=false)
Definition: ezproductcategory.php:789
eZProductCategory\options
& options()
Definition: ezproductcategory.php:889
eZProductCategory\setSortMode
setSortMode( $value)
Definition: ezproductcategory.php:538
eZProductCategory\$OptionArray
$OptionArray
Definition: ezproductcategory.php:1062
eZProductCategory\$Parent
$Parent
Definition: ezproductcategory.php:1060
eZProductCategory\moveUp
moveUp( $id)
Definition: ezproductcategory.php:909
eZProductCategory\addOption
addOption( $value)
Definition: ezproductcategory.php:857
eZProductCategory\$ImageID
$ImageID
Definition: ezproductcategory.php:1065
eZProductCategory\sortMode
& sortMode()
Definition: ezproductcategory.php:446
eZProductCategory\setDescription
setDescription(&$value)
Definition: ezproductcategory.php:510
eZProductCategory\setSectionID
setSectionID(&$value)
Definition: ezproductcategory.php:502
eZProductCategory\id
id()
Definition: ezproductcategory.php:358
eZProductCategory\getAll
& getAll()
Definition: ezproductcategory.php:250
eZProductCategory\$Description
$Description
Definition: ezproductcategory.php:1061
eZProductCategory\addProduct
static addProduct(&$value, $categoryid=false)
Definition: ezproductcategory.php:548
eZProductCategory\setImage
setImage( $value)
Definition: ezproductcategory.php:1037
eZProductCategory\description
& description()
Definition: ezproductcategory.php:413
eZProductCategory\getByRemoteID
getByRemoteID( $id, $parent=false)
Definition: ezproductcategory.php:982
eZProductCategory\copy
copy( $recursive=true, $id=false)
Definition: ezproductcategory.php:1030
eZProductCategory\moveDown
moveDown( $id)
Definition: ezproductcategory.php:946
eZProductCategory\path
& path( $categoryID=0)
Definition: ezproductcategory.php:305
eZProductCategory\store
store()
Definition: ezproductcategory.php:113
eZProductCategory\$RemoteID
$RemoteID
Definition: ezproductcategory.php:1064
eZProductCategory\setRemoteID
setRemoteID(&$value)
Definition: ezproductcategory.php:494
eZProductCategory\parent
& parent()
Definition: ezproductcategory.php:426
eZProductCategory\setParent
setParent( $parent)
Definition: ezproductcategory.php:518
eZProductCategory\activeProducts
& activeProducts( $sortMode="time", $offset=0, $limit=50, $categoryID=false)
Definition: ezproductcategory.php:845
eZProductCategory\$ID
$ID
Definition: ezproductcategory.php:1058
eZProductCategory\getByParent
& getByParent( $parent, $sortby='name')
Definition: ezproductcategory.php:272
eZProductCategory\products
static & products( $sortMode="time", $fetchNonActive=false, $offset=0, $limit=50, $fetchDiscontinued=false, $categoryID=0)
Definition: ezproductcategory.php:688
eZProductCategory\getTree
static & getTree( $parentID=0, $level=0)
Definition: ezproductcategory.php:335
eZProductCategory\$SectionID
$SectionID
Definition: ezproductcategory.php:1066
eZProductCategory\image
& image( $AsObject=true)
Definition: ezproductcategory.php:1048
eZProductCategory\sectionIDStatic
static sectionIDStatic( $categoryID)
Definition: ezproductcategory.php:394
eZProduct
Definition: ezproduct.php:71
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$name
$name
Definition: companytypelist.php:194
$id
$id
Definition: companytypelist.php:193
$query
if(isset( $Year) &&!is_numeric( $Year)||isset( $Month) &&!is_numeric( $Month)) $query
Definition: entryexitpages.php:65
$permission
$permission
Definition: eventedit.php:315
$tree
$tree
Definition: ezad/admin/categoryedit.php:172
$db
$db
Definition: ezarticle/user/authorlist.php:53
$groups
if( $CategoryID !=0) $groups
Definition: ezbulkmail/admin/categoryedit.php:108
$limit
$limit
Definition: ezimagecatalogue/admin/imagelist.php:312
$ret
$ret
Definition: ezsitemanager/admin/filelist.php:88
$res
$res
Definition: ezstats/admin/cron.php:45
$offset
$offset
Definition: ezstats/admin/cron.php:51
$product
$product
Definition: homepage.php:202
$categoryID
else $categoryID
Definition: productview.php:66
$OrderBy
$OrderBy
Definition: reciverpopup.php:21
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
$category_array
$category_array
Definition: todoedit.php:604
$user
$user
Definition: user/adlist.php:39
$image
$image
Definition: user/articlelist.php:242
$products
$products
Definition: user/imageview.php:142
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.