'integer', 'code' => 'string', 'apple_category' => 'string', 'google_category' => 'string', ]; public function getParent() { $category_model = new CategoryModel(); $parent_id = $this->attributes['parent_id']; return $parent_id != 0 ? $category_model->find($this->attributes['parent_id']) : null; } }