コード例 #1
0
 /**
  * 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()));
 }
コード例 #2
0
 /**
  * Collects profile debt operations.
  *
  * @return \Iterator
  */
 public function collect()
 {
     return $this->connectToStorageInternalWorker->connect()->find()->fields(['_id' => 0]);
 }
コード例 #3
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]);
 }