Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taskonsite-архив-перенесен
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitry Korolev
taskonsite-архив-перенесен
Commits
a831e9f1
Commit
a831e9f1
authored
Apr 28, 2016
by
Shakarim Sapa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Добавлено новые атрибуты и параметры валидации для поля template_id
parent
19aa3e59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
common/modules/blog/models/Post.php
common/modules/blog/models/Post.php
+13
-2
No files found.
common/modules/blog/models/Post.php
View file @
a831e9f1
...
...
@@ -15,6 +15,7 @@ use common\modules\users\models\User;
use
common\models\MetaTags
;
use
common\modules\sessions\models\SessionUrl
;
use
frontend\modules\sitemap\behaviors\SitemapBehavior
;
use
common\modules\messageTemplate\models\MessageTemplate
;
/**
* This is the model class for table "posts".
...
...
@@ -24,10 +25,12 @@ use frontend\modules\sitemap\behaviors\SitemapBehavior;
* @property integer $active
* @property integer $created_at
* @property integer $updated_at
* @property integer $template_id
*
* @property PostsLang[] $postsLangs
* @property PostsTagsAssign[] $postsTagsAssigns
* @property PostsTags[] $tags
* @property MessageTemplate $messageTemplate
*/
class
Post
extends
\common\components\ActiveRecordModel
{
...
...
@@ -79,10 +82,10 @@ class Post extends \common\components\ActiveRecordModel
{
return
[
[[
'url'
,
'active'
],
'required'
],
[[
'active'
,
'created_at'
,
'updated_at'
,
'author_id'
],
'integer'
],
[[
'
template_id'
,
'
active'
,
'created_at'
,
'updated_at'
,
'author_id'
],
'integer'
],
[[
'url'
],
'string'
,
'max'
=>
255
],
[[
'url'
],
'unique'
],
[[
'preview'
,
'unlinkFile'
,
'tags'
],
'safe'
],
[[
'preview'
,
'
template_id'
,
'
unlinkFile'
,
'tags'
],
'safe'
],
[[
'file'
],
'file'
,
'skipOnEmpty'
=>
true
,
'extensions'
=>
'png, jpg, jpeg, gif'
],
];
}
...
...
@@ -152,6 +155,7 @@ class Post extends \common\components\ActiveRecordModel
'unlinkFile'
=>
'Удалить изображение'
,
'created_at'
=>
'Дата добавления'
,
'updated_at'
=>
'Дата обновления'
,
'template_id'
=>
'Шаблон письма'
];
}
...
...
@@ -240,6 +244,13 @@ class Post extends \common\components\ActiveRecordModel
return
$this
->
hasOne
(
User
::
className
(),
[
'id'
=>
'author_id'
]);
}
/**
* @return MessageTemplate
*/
public
function
getMessageTemplate
(){
return
$this
->
hasOne
(
MessageTemplate
::
className
(),
[
'id'
=>
'template_id'
]);
}
/**
* @return \yii\db\ActiveQuery
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment