20 lines
436 B
PHP
20 lines
436 B
PHP
<?php
|
|
|
|
class Point extends Model
|
|
{
|
|
function __construct($fromArray = array())
|
|
{
|
|
$this->_tableName_ = 'points';
|
|
parent::__construct($fromArray);
|
|
$this->setRelation('category', 'categoryId', 'Category', 'id', self::TO_ONE);
|
|
$this->setRelation('authorUser', 'author', 'User', 'id', self::TO_ONE);
|
|
$this->setRelation('photos', 'id', 'Photo', 'pointId', self::TO_MANY);
|
|
}
|
|
|
|
static function model()
|
|
{
|
|
return new self();
|
|
}
|
|
}
|
|
|