Created
December 25, 2016 16:14
-
-
Save ImEmil/e360bd0a2e9b65c8993b63749bd0aaf6 to your computer and use it in GitHub Desktop.
BlackWolf Habbo Housekeeping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace models; | |
class DashboardModel extends AppModel | |
{ | |
/** | |
* @var string | |
*/ | |
public $primaryKey = 'id'; | |
/** | |
* @var string|array | |
*/ | |
public $table = ['users', 'catalog_items', 'furniture', 'bans', 'server_status']; | |
/** | |
* Get the total users count | |
* | |
* @return null|int | |
*/ | |
public function getUsersCount() | |
{ | |
$count = $this->count('users'); | |
return $count; | |
} | |
/** | |
* Get the total catalog items count | |
* | |
* @return null|int | |
*/ | |
public function getCatalogItemsCount() | |
{ | |
$count = $this->count('catalog_items'); | |
return $count; | |
} | |
/** | |
* Get the total furniture records count | |
* | |
* @return null|int | |
*/ | |
public function getFurnitureCount() | |
{ | |
$count = $this->count('furniture'); | |
return $count; | |
} | |
/** | |
* Get the total ban count | |
* | |
* @return null|int | |
*/ | |
public function getBannedUsersCount() | |
{ | |
$count = $this->count('bans'); | |
return $count; | |
} | |
/** | |
* Get the specific field value | |
* | |
* @param string $field Column name | |
* @return type | |
*/ | |
public function getServerStatus($field) | |
{ | |
$count = $this->getField($field, 'server_status'); | |
return $count; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment