src/Model/Table/TokensTable.php
public function stats() {
		$keys = [];
		$keys['unused_valid'] = $this->find('count', ['conditions' => [$this->getAlias() . '.used' => 0, $this->getAlias() . '.created >=' => date(FORMAT_DB_DATETIME, time() - $this->validity)]]);
		$keys['used_valid'] = $this->find('count', ['conditions' => [$this->getAlias() . '.used' => 1, $this->getAlias() . '.created >=' => date(FORMAT_DB_DATETIME, time() - $this->validity)]]);

		$keys['unused_invalid'] = $this->find('count', ['conditions' => [$this->getAlias() . '.used' => 0, $this->getAlias() . '.created <' => date(FORMAT_DB_DATETIME, time() - $this->validity)]]);
		$keys['used_invalid'] = $this->find('count', ['conditions' => [$this->getAlias() . '.used' => 1, $this->getAlias() . '.created <' => date(FORMAT_DB_DATETIME, time() - $this->validity)]]);

		$types = $this->find('all', ['conditions' => [], 'fields' => ['DISTINCT type']])->toArray();
		$keys['types'] = !empty($types) ? Hash::extract($types, '{n}.type') : [];
		return $keys;
	}
public function stats() {
		$keys = [];
		$keys['unused_valid'] = $this->find('count', ['conditions' => [$this->getAlias() . '.used' => 0, $this->getAlias() . '.created >=' => date(FORMAT_DB_DATETIME, time() - $this->validity)]]);
		$keys['used_valid'] = $this->find('count', ['conditions' => [$this->getAlias() . '.used' => 1, $this->getAlias() . '.created >=' => date(FORMAT_DB_DATETIME, time() - $this->validity)]]);

		$keys['unused_invalid'] = $this->find('count', ['conditions' => [$this->getAlias() . '.used' => 0, $this->getAlias() . '.created <' => date(FORMAT_DB_DATETIME, time() - $this->validity)]]);
		$keys['used_invalid'] = $this->find('count', ['conditions' => [$this->getAlias() . '.used' => 1, $this->getAlias() . '.created <' => date(FORMAT_DB_DATETIME, time() - $this->validity)]]);

		$types = $this->find('all', ['conditions' => [], 'fields' => ['DISTINCT type']])->toArray();
		$keys['types'] = !empty($types) ? Hash::extract($types, '{n}.type') : [];
		return $keys;
	}
public function stats ( ) { $ keys = [ ] ; $ keys [ 'unused_valid' ] = $ this -> find ( 'count' , [ 'conditions' => [ $ this -> getAlias ( ) . '.used' => 0 , $ this -> getAlias ( ) . '.created >=' => date ( FORMAT_DB_DATETIME , time ( ) - $ this -> validity ) ] ] ) ; $ keys [ 'used_valid' ] = $ this -> find ( 'count' , [ 'conditions' => [ $ this -> getAlias ( ) . '.used' => 1 , $ this -> getAlias ( ) . '.created >=' => date ( FORMAT_DB_DATETIME , time ( ) - $ this -> validity ) ] ] ) ; $ keys [ 'unused_invalid' ] = $ this -> find ( 'count' , [ 'conditions' => [ $ this -> getAlias ( ) . '.used' => 0 , $ this -> getAlias ( ) . '.created <' => date ( FORMAT_DB_DATETIME , time ( ) - $ this -> validity ) ] ] ) ; $ keys [ 'used_invalid' ] = $ this -> find ( 'count' , [ 'conditions' => [ $ this -> getAlias ( ) . '.used' => 1 , $ this -> getAlias ( ) . '.created <' => date ( FORMAT_DB_DATETIME , time ( ) - $ this -> validity ) ] ] ) ; $ types = $ this -> find ( 'all' , [ 'conditions' => [ ] , 'fields' => [ 'DISTINCT type' ] ] ) -> toArray ( ) ; $ keys [ 'types' ] = ! empty ( $ types ) ? Hash :: extract ( $ types , '{n}.type' ) : [ ] ; return $ keys ; }
Get admin stats

@return array
Get admin stats