Initial import
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace app\models;
|
||||
|
||||
/**
|
||||
* Class Navigation
|
||||
* @package app\models
|
||||
* @property string $menu_type
|
||||
* @property string $name
|
||||
* @property string $ts_en_name
|
||||
* @property int $order_index
|
||||
* @property int $page_id
|
||||
* @property $url
|
||||
* @property $relation_type
|
||||
* @property $is_active
|
||||
* @property $in_submenu
|
||||
* [relations]
|
||||
* @property Pages $page
|
||||
*/
|
||||
class Navigation extends _Base
|
||||
{
|
||||
public function getPage() {
|
||||
return $this->hasOne(Pages::class, ['id' => 'page_id']);
|
||||
}
|
||||
|
||||
public function isRelationType($type) {
|
||||
$currentType = $this->relation_type ?? 'inner_page';
|
||||
$this->relation_type = $currentType;
|
||||
return $type == $currentType ? 'checked' : '';
|
||||
}
|
||||
public function isRelationTypeFor($type) {
|
||||
if($type != $this->relation_type) {
|
||||
return 'readonly class="disabled"';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user