~automne-team/automne/4.2

« back to all changes in this revision

Viewing changes to automne/classes/modules/polymod/polyobjects/poly_object.php

  • Committer: sebastien-pauchet
  • Date: 2012-01-13 13:13:00 UTC
  • Revision ID: seb@automne-cms.org-20120113131300-33kvm2zhfcdz0kbb
Change method to load CMS_object_definition to use static cache.
Correct a bug in 403.php and test for htaccess support

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
// +----------------------------------------------------------------------+
12
12
// | Author: S�bastien Pauchet <sebastien.pauchet@ws-interactive.fr>      |
13
13
// +----------------------------------------------------------------------+
14
 
//
15
 
// $Id: poly_object.php,v 1.17 2010/03/08 16:43:33 sebastien Exp $
16
14
 
17
15
/**
18
16
  * Class CMS_poly_object
550
548
          * @access public
551
549
          */
552
550
        function getObjectDefinition () {
553
 
                //create cache object
554
 
                $cache = new CMS_cache('object'.$this->_objectID, 'atm-polymod-structure', 2592000, false);
555
 
                $datas = '';
556
 
                if (!$cache->exist() || !($datas = $cache->load())) {
557
 
                        //datas does not exists : load it
558
 
                        $datas = new CMS_poly_object_definition($this->_objectID);
559
 
                        if ($cache) {
560
 
                                $cache->save($datas, array('type' => 'object'));
561
 
                        }
562
 
                }
563
 
                return $datas;
 
551
                return CMS_poly_object_catalog::getObjectDefinition($this->_objectID);
564
552
        }
565
553
        
566
554
        /**
2309
2297
                                                $categoriesFields = CMS_poly_object_catalog::objectHasCategories($objectParentID);
2310
2298
                                                if (is_array($categoriesFields) && $categoriesFields) {
2311
2299
                                                        //load current object definition
2312
 
                                                        $object = new CMS_poly_object_definition($objectParentID);
 
2300
                                                        $object = CMS_poly_object_catalog::getObjectDefinition($objectParentID);
2313
2301
                                                        foreach($objectParentFields as $fieldID) {
2314
2302
                                                                $search = new CMS_object_search($object,$this->_public);
2315
2303
                                                                $search->addWhereCondition($fieldID, $this->getID());