setNumUsers() public method

Set the number of users
public setNumUsers ( integer $numUsers ) : Stats
$numUsers integer The number of users that has one or more images
return Stats
Exemplo n.º 1
0
 /**
  * @covers Imbo\Model\Stats::getData
  */
 public function testGetData()
 {
     $this->model->setNumUsers(100)->setNumBytes(1000)->setNumImages(10000);
     $this->model['some'] = 'value';
     $this->assertSame(['numUsers' => 100, 'numBytes' => 1000, 'numImages' => 10000, 'customStats' => ['some' => 'value']], $this->model->getData());
 }
Exemplo n.º 2
0
 /**
  * Load stats
  *
  * @param EventInterface $event An event instance
  */
 public function loadStats(EventInterface $event)
 {
     $response = $event->getResponse();
     $database = $event->getDatabase();
     $statsModel = new Model\Stats();
     $statsModel->setNumUsers($database->getNumUsers());
     $statsModel->setNumBytes($database->getNumBytes());
     $statsModel->setNumImages($database->getNumImages());
     $response->setModel($statsModel);
 }