.

DAOCountries Class Reference
[Countries]

Model class for countries. More...

Inheritance diagram for DAOCountries:
DataObjectBase ISelfDescribing IHierarchic IDataObject IActionSource ISearchAdapter IDBTable IDBWhereHolder

List of all members.

Public Member Functions

  get_childs ()
  Get childs for this item.
  get_continent ()
  Returns continent of this country.
  get_description ()
  Get description for this instance.
  get_parent ()
  Get parent for this item.
  get_title ()
  Get title for this class.
  is_in_group ($group_id)
  Returns whether country is in group or not.

Public Attributes

  $code3
  $codenum
  $id
  $id_continent
  $name

Protected Member Functions

  create_table_object ()
  Create table definition.

Detailed Description

Model class for countries.

Author:
Gerd Riesselmann

Definition at line 8 of file countries.model.php.


Member Function Documentation

DAOCountries::create_table_object (  )  [protected]

Create table definition.

Returns:
DBTable

Reimplemented from DataObjectBase.

Definition at line 20 of file countries.model.php.

00020                                              {
00021         return new DBTable(
00022             'countries',
00023             array(
00024                 new DBFieldText('id', 2, null, DBField::NOT_NULL),
00025                 new DBFieldText('id_continent', 2, null, DBField::NOT_NULL),
00026                 new DBFieldText('name', 50, null, DBField::NOT_NULL),
00027                 new DBFieldText('code3', 3, null, DBField::NONE),
00028                                 new DBFieldInt('codenum', null, DBField::NONE)
00029             ),
00030             'id',
00031             new DBRelation(
00032                 'continents',
00033                 new DBFieldRelation('id_continent', 'id')
00034             )
00035         );
00036     }
DAOCountries::get_childs (  ) 

Get childs for this item.

Returns:
array Array of IHierarchic items

Implements IHierarchic.

Definition at line 100 of file countries.model.php.

00100                                      {
00101                 return array();
00102         }
DAOCountries::get_continent (  ) 

Returns continent of this country.

Returns:
DAOContinents

Definition at line 43 of file countries.model.php.

00043                                     {
00044         return Countries::get_continent($this->id_continent);
00045     }
DAOCountries::get_description (  ) 

Get description for this instance.

Returns:
string

Implements ISelfDescribing.

Definition at line 78 of file countries.model.php.

00078                                           {
00079                 return '';
00080         }
DAOCountries::get_parent (  ) 

Get parent for this item.

Returns:
IHierarchic Parent item or null

Implements IHierarchic.

Definition at line 91 of file countries.model.php.

00091                                      {
00092                 return $this->get_continent();
00093         }
DAOCountries::get_title (  ) 

Get title for this class.

Returns:
string

Implements ISelfDescribing.

Definition at line 69 of file countries.model.php.

00069                                     {
00070                 return tr($this->name, 'countries');
00071         }
DAOCountries::is_in_group ( group_id  ) 

Returns whether country is in group or not.

Parameters:
int  $group_id ID of group
Returns:
bool

Definition at line 53 of file countries.model.php.

00053                                                {
00054                 $link = new DAOCountries2countriesgroups();
00055                 $link->id_group = $group_id;
00056                 $link->id_country = $this->id;
00057                 return $link->count() > 0;
00058         }

Member Data Documentation

DAOCountries::$code3

Definition at line 11 of file countries.model.php.

DAOCountries::$codenum

Definition at line 12 of file countries.model.php.

DAOCountries::$id

Definition at line 9 of file countries.model.php.

DAOCountries::$id_continent

Definition at line 10 of file countries.model.php.

DAOCountries::$name

Definition at line 13 of file countries.model.php.


The documentation for this class was generated from the following file: