Skip to content

Commit

Permalink
measure is now observable #35
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuNls committed Nov 24, 2015
1 parent 85645cd commit 5f5c109
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions application/models/Measure.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php if (!defined('BASEPATH')) {exit('No direct script access allowed');
}

class Measure extends MY_Model {
class Measure extends ObservableModel {

function __construct() {
parent::__construct();
Expand Down Expand Up @@ -90,12 +90,6 @@ function addBaseMesure($watchId, $referenceTime, $userTime) {

$returnValue = $this->insert($data);

if ($returnValue) {
$this->notify(NEW_MEASURE,
array('user' => arrayToObject($this->session->all_userdata),
'measure' => $data));
}

return $returnValue;
}

Expand All @@ -112,8 +106,7 @@ function addAccuracyMesure($measureId, $referenceTime, $userTime) {
$watchMeasure->accuracy = $this->computeAccuracy($watchMeasure);

$this->notify(NEW_ACCURACY,
array('user' => arrayToObject($this->session->all_userdata),
'measure' => $watchMeasure));
array('measure' => $watchMeasure));

return $watchMeasure;
}
Expand All @@ -140,4 +133,4 @@ function getMeasuresCountByWatchBrand($watchBrand) {
->cnt;
}

}
}

0 comments on commit 5f5c109

Please sign in to comment.