/** * Logs a debt operation. * * @param string $uniqueness * @param int $amount * @param string $impact * @param string $description */ public function log($uniqueness, $amount, $impact, $description) { $this->connectToStorageInternalWorker->connect()->insert(array('uniqueness' => $uniqueness, 'amount' => $amount, 'impact' => $impact, 'description' => $description, 'created' => time())); }
/** * Collects profile debt operations. * * @return \Iterator */ public function collect() { return $this->connectToStorageInternalWorker->connect()->find()->fields(['_id' => 0]); }
/** * Collect operations for given uniqueness. * * @param string $uniqueness * * @return \Iterator An array of operations with the following keys: * uniqueness, amount, impact, description and created */ public function collect($uniqueness) { return $this->connectToStorageInternalWorker->connect()->find(['uniqueness' => $uniqueness])->fields(['_id' => 0])->sort(['created' => -1]); }