POT
POT
POT
Main menu

Download

Forum

SVN

Class: OTS_Item

Source Location: /classes/OTS_Item.php

Class OTS_Item

Class Overview

Implements interfaces:

  • Countable (internal interface)

Single item representation.

Single item representation. This class represents item that player has. It has no information about item feature, just it's handle in database. To get information about item type and it's features you have to use OTS_ItemType class - you can get it's object by calling getItemType() method, however you need to have global item types list loaded.

Located in /classes/OTS_Item.php [line 30]



		
				Author(s):
		
API Tags:
Property:  int $count: Amount of item.
Property:  string $attributes: Attributes binary string.
Property-read:  int $id: Item type ID.
Property-read:  OTS_ItemType $itemType: Item type instance.

Information Tags:
Version:  0.1.0
Version:  0.0.3
Since:  0.0.3

Methods

[ Top ]
Descendants
Child Class Description
OTS_Container Container item representation.

[ Top ]
Method Summary
OTS_Item   __construct()   Creates item of given ID.
int   count()   Count value for current item.
string   getAttributes()   Returns item custom attributes.
int   getCount()   Returns count of item.
int   getId()   Returns item type.
OTS_ItemType   getItemType()   Returns type of item.
void   setAttributes()   Sets item attributes.
void   setCount()   Sets count of item.
mixed   __get()   Magic PHP5 method.
void   __set()   Magic PHP5 method.

[ Top ]
Methods
Constructor __construct  [line 58]

  OTS_Item __construct( int $id  )

Creates item of given ID.

Creates item of given ID.

Parameters:
int   $id:  Item ID.

API Tags:
Access:  public

Information Tags:
Version:  0.0.3
Since:  0.0.3

[ Top ]
count  [line 131]

  int count( )

Count value for current item.

Count value for current item.


API Tags:
Return:  Count of item.
Access:  public

Information Tags:
Version:  0.0.3
Since:  0.0.3

Implementation of:
Countable::count

Redefined in descendants as:

[ Top ]
getAttributes  [line 98]

  string getAttributes( )

Returns item custom attributes.

Returns item custom attributes.


API Tags:
Return:  Attributes.
Access:  public

Information Tags:
Version:  0.0.3
Since:  0.0.3

[ Top ]
getCount  [line 78]

  int getCount( )

Returns count of item.

Returns count of item.


API Tags:
Return:  Count of item.
Access:  public

Information Tags:
Version:  0.0.3
Since:  0.0.3

[ Top ]
getId  [line 68]

  int getId( )

Returns item type.

Returns item type.


API Tags:
Return:  Item ID.
Access:  public

Information Tags:
Version:  0.0.3
Since:  0.0.3

[ Top ]
getItemType  [line 121]

  OTS_ItemType getItemType( )

Returns type of item.

Returns type of item.


API Tags:
Return:  Returns item type of item (null if not exists).
Access:  public

Information Tags:
Version:  0.1.0
Version:  0.0.3
Throws:  E_OTS_NotLoaded If global items list wasn't loaded.
Since:  0.1.0
Since:  0.0.3

[ Top ]
setAttributes  [line 108]

  void setAttributes( string $attributes  )

Sets item attributes.

Sets item attributes.

Parameters:
string   $attributes:  Item Attributes.

API Tags:
Access:  public

Information Tags:
Version:  0.0.3
Since:  0.0.3

[ Top ]
setCount  [line 88]

  void setCount( int $count  )

Sets count of item.

Sets count of item.

Parameters:
int   $count:  Count.

API Tags:
Access:  public

Information Tags:
Version:  0.0.3
Since:  0.0.3

[ Top ]
__get  [line 146]

  mixed __get( string $name  )

Magic PHP5 method.

Magic PHP5 method.

Parameters:
string   $name:  Property name.

API Tags:
Return:  Property value.
Access:  public

Information Tags:
Version:  0.1.0
Version:  0.0.3
Throws:  E_OTS_NotLoaded If global items list wasn't loaded.
Throws:  OutOfBoundsException For non-supported properties.
Since:  0.0.3
Since:  0.1.0

[ Top ]
__set  [line 176]

  void __set( string $name, mixed $value  )

Magic PHP5 method.

Magic PHP5 method.

Parameters:
string   $name:  Property name.
mixed   $value:  Property value.

API Tags:
Access:  public

Information Tags:
Version:  0.1.0
Version:  0.0.3
Throws:  OutOfBoundsException For non-supported properties.
Since:  0.1.0
Since:  0.0.3

[ Top ]