Changeset 1414
- Timestamp:
- Sep 25, 2010, 9:55:49 PM (10 years ago)
- Location:
- cpc/trunk/project/lib/model
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
cpc/trunk/project/lib/model/doctrine/Commentaire.class.php
r1377 r1414 11 11 } 12 12 public function getPersonne() { 13 return $this->getCitoyen()->getLogin(); 13 if ($this->getCitoyen()) 14 return $this->getCitoyen()->getLogin(); 15 return ''; 14 16 } 15 17 public function getTitre() { … … 80 82 81 83 public function updateNbCommentaires($inc = 0) { 82 $o = Doctrine::getTable($this->object_type)->find($this->object_id); 83 $o->updateNbCommentaires($inc); 84 if ($this->object_type) { 85 $o = Doctrine::getTable($this->object_type)->find($this->object_id); 86 $o->updateNbCommentaires($inc); 87 } 84 88 foreach ($this->getObjects() as $object) { 85 89 $o = Doctrine::getTable($object->object_type)->find($object->object_id); … … 89 93 } 90 94 91 public function setIsPublic($b) {92 $this->_set('is_public', $b);93 if ($this->id) {94 $this->updateNbCommentaires(($b) ? 1 : -1);95 }96 }97 95 public function getLien() { 98 96 return preg_replace('/@amendement\?id=/', '@amendement_id?id=', $this->_get('lien')); 99 97 } 98 99 public function save(Doctrine_Connection $c = null) { 100 parent::save($c); 101 $b = $this->is_public; 102 $this->updateNbCommentaires(($b) ? 1 : -1); 103 } 100 104 } -
cpc/trunk/project/lib/model/doctrine/ParlementairePhoto.class.php
r1407 r1414 19 19 return base64_decode($this->_get('photo')); 20 20 } 21 public function save(Doctrine_Connection $c = null) {22 return parent::save($c);23 }24 21 } -
cpc/trunk/project/lib/model/solr/SolrListener.php
r1405 r1414 72 72 73 73 $t = null; 74 if (isset( $this->_options['index_if']) && $t = $this->_options['index_if'] && $t && !$obj->get($t)) 75 return ; 74 if (isset( $this->_options['index_if']) && $t = $this->_options['index_if']) { 75 if (!($obj->get($t))) { 76 return $this->postDelete($event); 77 } 78 } 76 79 77 80 $json = array(); … … 79 82 $json['object_id'] = $obj->getId(); 80 83 $json['object_name'] = get_class($obj); 81 82 84 if (isset($this->_options['description']) && $t = $this->_options['description']) { 83 85 $content = $this->getObjFieldsValue($obj, $t);
Note: See TracChangeset
for help on using the changeset viewer.