Skip to content

Instantly share code, notes, and snippets.

@ImEmil
Created December 25, 2016 16:14
Show Gist options
  • Save ImEmil/e360bd0a2e9b65c8993b63749bd0aaf6 to your computer and use it in GitHub Desktop.
Save ImEmil/e360bd0a2e9b65c8993b63749bd0aaf6 to your computer and use it in GitHub Desktop.
BlackWolf Habbo Housekeeping
<?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