public function getBarcodeHistory(RM_Barcode_object $obBarcode, $idState) { $query = M('Db')->createQuery($this->_tables['barcode_control'])->what('*')->where('barcode = ?', $obBarcode->value)->where('id <= ?', $idState)->order('id asc'); $state = M('Barcode')->control()->validate($obBarcode->props()); foreach ($query->execute() as $row) { $curstate = unserialize($row['diff']); foreach ($curstate as $key => $value) { $state[$key] = $value; } } return M('Barcode')->control()->resolveEntityNamesByIds($state); }
public function checkFake(RM_Barcode_object $obBarcode) { if ($obBarcode->isFake()) { $res = M('Base')->result(); $res->error('barcode_is_fake'); throw new RM_Validator_Exception($res); } return true; }