コード例 #1
0
 public function delete()
 {
     parent::delete();
     if ($contributor = $this->getContributor()) {
         $contributor->calcContributioncount();
     }
 }
コード例 #2
0
 /**
  * Fetches file size if necessary.
  *
  * @override Base::save()
  */
 public function save()
 {
     if (!$this->size) {
         $this->determine_file_size();
     }
     return parent::save();
 }
コード例 #3
0
 public function save()
 {
     global $wpdb;
     if (!$this->position) {
         $pos = $wpdb->get_var(sprintf('SELECT MAX(position)+1 FROM %s WHERE contributor_id = %d', self::table_name(), $this->contributor_id));
         $this->position = $pos ? $pos : 1;
     }
     parent::save();
 }
コード例 #4
0
 /**
  * @override \Podlove\Model\Base::delete();
  */
 public function delete()
 {
     foreach ($this->getContributions() as $contribution) {
         $contribution->delete();
     }
     foreach ($this->getShowContributions() as $contribution) {
         $contribution->delete();
     }
     foreach ($this->getDefaultContributions() as $contribution) {
         $contribution->delete();
     }
     parent::delete();
 }