PHP Class app\models\Closet

Show file Open project: printempw/blessing-skin-server Class Usage Examples

Public Properties

Property Type Description
$uid

Public Methods

Method Description
__construct ( integer $uid ) Construct Closet object with owner's uid.
__destruct ( ) Save when the object will be destructed.
add ( integer $tid, string $name ) : boolean Add an item to the closet.
getItems ( string $category = "all" ) : array Get array of instances of App\Models\Texture.
has ( integer $tid ) : boolean Check if texture is in the closet.
remove ( integer $tid ) : boolean Remove a texture from closet.
rename ( integer $tid, string $new_name ) : void Rename closet item.
save ( ) : boolean Do really database operations.
setTextures ( string $textures ) Set textures string manually.

Private Methods

Method Description
checkTextureExist ( integer $tid ) : boolean Check if given tid is valid.

Method Details

__construct() public method

Construct Closet object with owner's uid.
public __construct ( integer $uid )
$uid integer

__destruct() public method

Save when the object will be destructed.
public __destruct ( )

add() public method

Add an item to the closet.
public add ( integer $tid, string $name ) : boolean
$tid integer
$name string
return boolean

getItems() public method

Get array of instances of App\Models\Texture.
public getItems ( string $category = "all" ) : array
$category string skin|cape|all
return array

has() public method

Check if texture is in the closet.
public has ( integer $tid ) : boolean
$tid integer
return boolean

remove() public method

Remove a texture from closet.
public remove ( integer $tid ) : boolean
$tid integer
return boolean

rename() public method

Rename closet item.
public rename ( integer $tid, string $new_name ) : void
$tid integer
$new_name string
return void

save() public method

Do really database operations.
public save ( ) : boolean
return boolean

setTextures() public method

Set textures string manually.
public setTextures ( string $textures )
$textures string

Property Details

$uid public property

public $uid