ecom
E-commerce cms
 All Data Structures Namespaces Files Functions Variables
Public Member Functions | Protected Member Functions | Private Attributes
Meta Class Reference
Inheritance diagram for Meta:
ModelBase

Public Member Functions

 __get ($key)
 
 __set ($key, $value)
 
- Public Member Functions inherited from ModelBase
 __construct ($id=null)
 
 getTableName ()
 
 getMeta ($lang=null)
 
 __get ($key)
 
 __set ($key, $value)
 
 save ()
 
 delete ()
 
 selects ($criteria=null, $orderBy=null)
 
 selectById ($id)
 

Protected Member Functions

 install ()
 
- Protected Member Functions inherited from ModelBase
 install ()
 

Private Attributes

 $entity
 

Additional Inherited Members

- Static Public Member Functions inherited from ModelBase
static init ($config=null)
 
static getDbPrefix ()
 
static setup ()
 
- Static Protected Attributes inherited from ModelBase
static $dbo = null
 

Detailed Description

Definition at line 5 of file Meta.php.

Member Function Documentation

__get (   $key)

Definition at line 25 of file Meta.php.

26  {
27  if ($key == "entity")
28  return $this->entity;
29  return parent::__get($key);
30  }
__set (   $key,
  $value 
)

Definition at line 32 of file Meta.php.

33  {
34  if ($key == "entity")
35  {
36  parent::__set("entityId", $value->id);
37  parent::__set("entityType", get_class($value));
38  return $value;
39  }
40  else if ($key == "entityId" || $key == "entityType")
41  throw new \Exception("Cannot access private field {$key}");
42  return parent::__set($key, $value);
43  }
install ( )
protected

Definition at line 9 of file Meta.php.

10  {
11  $dbPrefix = $this->getDbPrefix();
12  $result = self::$dbo->exec("CREATE TABLE IF NOT EXISTS `{$dbPrefix}meta` (
13  `entity_id` INTEGER(11) UNSIGNED NOT NULL,
14  `entityType` VARCHAR(32) NOT NULL,
15  `lang` VARCHAR(8) NULL,
16  `key` VARCHAR(64) NOT NULL,
17  `value` TEXT NULL,
18  UNIQUE(`entity_id`, `entityType`, `lang`)
19  )");
20  if ($result === false)
21  throw new \Exception(get_class().": ".self::$dbo->errorInfo()[2]);
22  return true;
23  }
static getDbPrefix()
Definition: ModelBase.php:42

Field Documentation

$entity
private

Definition at line 7 of file Meta.php.


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