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
9877397e
Commit
9877397e
authored
Mar 24, 2016
by
Shakarim Sapa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Поле template_id добавлено в модель
parent
2bd62ee2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
common/modules/content/models/CoContent.php
common/modules/content/models/CoContent.php
+11
-1
No files found.
common/modules/content/models/CoContent.php
View file @
9877397e
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
common\modules\content\models
;
namespace
common\modules\content\models
;
use
common\modules\messageTemplate\models\MessageTemplate
;
use
Yii
;
use
Yii
;
use
yii\behaviors\TimestampBehavior
;
use
yii\behaviors\TimestampBehavior
;
use
frontend\modules\sitemap\behaviors\SitemapBehavior
;
use
frontend\modules\sitemap\behaviors\SitemapBehavior
;
...
@@ -22,6 +23,7 @@ use common\models\MetaTags;
...
@@ -22,6 +23,7 @@ use common\models\MetaTags;
* @property string $title
* @property string $title
* @property string $text
* @property string $text
* @property integer $active
* @property integer $active
* @property integer $template_id
* @property integer $created_at
* @property integer $created_at
* @property integer $updated_at
* @property integer $updated_at
*
*
...
@@ -115,7 +117,7 @@ class CoContent extends \common\components\ActiveRecordModel
...
@@ -115,7 +117,7 @@ class CoContent extends \common\components\ActiveRecordModel
public
function
rules
()
public
function
rules
()
{
{
return
[
return
[
[[
'active'
,
'type'
],
'integer'
],
[[
'active'
,
'type'
,
'template_id'
],
'integer'
],
[[
'file'
],
'file'
,
'skipOnEmpty'
=>
true
,
'extensions'
=>
'png, jpg, jpeg, gif'
],
[[
'file'
],
'file'
,
'skipOnEmpty'
=>
true
,
'extensions'
=>
'png, jpg, jpeg, gif'
],
[[
'url'
,
'type'
,
'priority'
],
'required'
],
[[
'url'
,
'type'
,
'priority'
],
'required'
],
[[
'url'
],
'string'
,
'max'
=>
250
],
[[
'url'
],
'string'
,
'max'
=>
250
],
...
@@ -142,6 +144,7 @@ class CoContent extends \common\components\ActiveRecordModel
...
@@ -142,6 +144,7 @@ class CoContent extends \common\components\ActiveRecordModel
'active'
=>
Yii
::
t
(
'content'
,
'Active'
),
'active'
=>
Yii
::
t
(
'content'
,
'Active'
),
'created_at'
=>
Yii
::
t
(
'content'
,
'Created At'
),
'created_at'
=>
Yii
::
t
(
'content'
,
'Created At'
),
'updated_at'
=>
Yii
::
t
(
'content'
,
'Updated At'
),
'updated_at'
=>
Yii
::
t
(
'content'
,
'Updated At'
),
'template_id'
=>
'Шаблон для рассылки'
];
];
}
}
...
@@ -181,6 +184,13 @@ class CoContent extends \common\components\ActiveRecordModel
...
@@ -181,6 +184,13 @@ class CoContent extends \common\components\ActiveRecordModel
return
$this
->
hasOne
(
CoCategory
::
className
(),
[
'id'
=>
'category_id'
]);
return
$this
->
hasOne
(
CoCategory
::
className
(),
[
'id'
=>
'category_id'
]);
}
}
/**
* @return \yii\db\ActiveQuery
*/
public
function
getTemplate
()
{
return
$this
->
hasOne
(
MessageTemplate
::
className
(),
[
'id'
=>
'template_id'
]);
}
public
function
getLang
(
$lang_id
=
null
)
public
function
getLang
(
$lang_id
=
null
)
{
{
$lang_id
=
(
$lang_id
===
null
)
?
Languages
::
getCurrent
()
->
id
:
$lang_id
;
$lang_id
=
(
$lang_id
===
null
)
?
Languages
::
getCurrent
()
->
id
:
$lang_id
;
...
...
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