All Data Structures Namespaces Files Functions Variables
Meta Class Reference
Inheritance diagram for Meta:

## 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.

{
if ($key == "entity")
return $this->entity;
return parent::__get($key);
}
Entity\Meta\$entity
$entity
Definition: Meta.php:7

__set | ( |  | $key,
|  |  | $value
| ) |  |

Definition at line 32 of file Meta.php.

{
if ($key == "entity")
{
parent::__set("entityId", $value->id);
parent::__set("entityType", get_class($value));
return $value;
}
else if ($key == "entityId" || $key == "entityType")
throw new \Exception("Cannot access private field {$key}");
return parent::__set($key, $value);
}

install | ( |  | ) |

protected

Definition at line 9 of file Meta.php.

{
$dbPrefix = $this->getDbPrefix();
$result = self::$dbo->exec("CREATE TABLE IF NOT EXISTS `{$dbPrefix}meta` (
`entity_id` INTEGER(11) UNSIGNED NOT NULL,
`entityType` VARCHAR(32) NOT NULL,
`lang` VARCHAR(8) NULL,
`key` VARCHAR(64) NOT NULL,
`value` TEXT NULL,
UNIQUE(`entity_id`, `entityType`, `lang`)
)");
if ($result === false)
throw new \Exception(get_class().": ".self::$dbo->errorInfo()[2]);
return true;
}
Entity\ModelBase\getDbPrefix
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:

- core/models/Meta.php