Ejemplo n.º 1
0
 public function reset($entryId)
 {
     // get record from the database
     $entryCountRecord = EntryCountRecord::model()->findByAttributes(array('entryId' => $entryId));
     // if the record exists, delete it from the database
     if ($entryCountRecord) {
         $entryCountRecord->delete();
     }
 }
Ejemplo n.º 2
0
 /**
  * Reset count
  *
  * @param int $entryId
  */
 public function reset($entryId)
 {
     // get record from DB
     $entryCountRecord = EntryCountRecord::model()->findByAttributes(array('entryId' => $entryId));
     // if record exists then delete
     if ($entryCountRecord) {
         // delete record from DB
         $entryCountRecord->delete();
     }
     // log reset
     EntryCountPlugin::log('Entry count with entry ID ' . $entryId . ' reset by ' . craft()->userSession->getUser()->username, LogLevel::Info, true);
     // fire an onResetCount event
     $this->onResetCount(new Event($this, array('entryId' => $entryId)));
 }