/**
 * This is the model class for table "{{%cms_content_element}}".
 *
 * @property integer $id
 * @property integer $created_by
 * @property integer $updated_by
 * @property integer $created_at
 * @property integer $updated_at
 * @property integer $published_at
 * @property integer $published_to
 * @property integer $priority
 * @property string $active
 * @property string $name
 * @property string $code
 * @property string $description_short
 * @property string $description_full
 * @property integer $content_id
 * @property integer $image_id
 * @property integer $image_full_id
 * @property integer $tree_id
 * @property integer $show_counter
 * @property integer $show_counter_start
 * @property string $meta_title
 * @property string $meta_description
 * @property string $meta_keywords
 *
 * @property integer $parent_content_element_id version > 2.4.8
 *
 *
 * @property string $permissionName
 *
 * @property string $description_short_type
 * @property string $description_full_type
 *
 * @property string $absoluteUrl
 * @property string $url
 *
 * @property CmsContent $cmsContent
 * @property Tree $cmsTree

 * @property CmsContentElementProperty[]    $relatedElementProperties
 * @property CmsContentProperty[]           $relatedProperties
 * @property CmsContentElementTree[]        $cmsContentElementTrees
 * @property CmsContentElementProperty[]    $cmsContentElementProperties
 * @property CmsContentProperty[]           $cmsContentProperties
 *
 * @property CmsStorageFile $image
 * @property CmsStorageFile $fullImage
 *
 * @property CmsContentElementFile[] $cmsContentElementFiles
 * @property CmsContentElementImage[] $cmsContentElementImages
 *
 * @property CmsStorageFile[] $files
 * @property CmsStorageFile[] $images
 *
 * @version > 2.4.8
 * @property CmsContentElement $parentContentElement
 * @property CmsContentElement[] $childrenContentElements
 *
 * @property CmsContentElement2cmsUser[] $cmsContentElement2cmsUsers
 * @property CmsUser[] $usersToFavorites
 *
 */

 

$model = \skeeks\cms\models\CmsContentElement::findOne(10);

//Главное изображение
if ($model->image)
{
    $model->image->src;
}


//Главный раздел
if ($model->cmsTree)
{
    $model->cmsTree->name;
}


//Второстепенные разделы
if ($model->cmsTrees)
{
    foreach ($model->cmsTrees as $tree)
    {
        $tree->name;
    }
}

 


Все комментарии (0)
Нет комментариев