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
9c8927b0
Commit
9c8927b0
authored
Feb 02, 2016
by
Shakarim Sapa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Изменен родительский класс active record. Добавлен новый валидатор (пока что не отлаженый)
parent
e2fde3a9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
3 deletions
+27
-3
common/modules/triggers/models/TriggerTrigger.php
common/modules/triggers/models/TriggerTrigger.php
+27
-3
No files found.
common/modules/triggers/models/TriggerTrigger.php
View file @
9c8927b0
...
@@ -21,10 +21,17 @@ use common\modules\users\models\User;
...
@@ -21,10 +21,17 @@ use common\modules\users\models\User;
* @property TriggerConnection[] $triggerConnections
* @property TriggerConnection[] $triggerConnections
* @property User $owner
* @property User $owner
*/
*/
class
TriggerTrigger
extends
\
yii\db\ActiveRecord
class
TriggerTrigger
extends
\
common\components\ActiveRecordModel
{
{
const
PAGE_SIZE
=
10
;
public
$conditions
=
[];
public
$conditions
=
[];
public
function
name
()
{
return
'Триггеры'
;
}
/**
/**
* @inheritdoc
* @inheritdoc
*/
*/
...
@@ -33,6 +40,11 @@ class TriggerTrigger extends \yii\db\ActiveRecord
...
@@ -33,6 +40,11 @@ class TriggerTrigger extends \yii\db\ActiveRecord
return
'trigger_trigger'
;
return
'trigger_trigger'
;
}
}
public
function
behaviors
()
{
return
[];
}
/**
/**
* @inheritdoc
* @inheritdoc
*/
*/
...
@@ -40,14 +52,26 @@ class TriggerTrigger extends \yii\db\ActiveRecord
...
@@ -40,14 +52,26 @@ class TriggerTrigger extends \yii\db\ActiveRecord
{
{
return
[
return
[
[[
'active'
,
'owner_id'
,
'timeout'
,
'message_template_id'
],
'integer'
],
[[
'active'
,
'owner_id'
,
'timeout'
,
'message_template_id'
],
'integer'
],
[[
'name'
,
'owner_id'
],
'required'
],
[[
'name'
,
'owner_id'
,
'timeout'
],
'required'
],
[[
'description'
],
'string'
],
[[
'description'
],
'string'
],
[[
'date_create'
],
'safe'
],
[[
'date_create'
],
'safe'
],
[[
'name'
],
'string'
,
'max'
=>
255
],
[[
'name'
],
'string'
,
'max'
=>
255
],
[[
'conditions'
],
function
(
$attribute
,
$params
)
{
$this
->
addError
(
$attribute
,
'asd'
);
}],
[[
'owner_id'
],
'exist'
,
'skipOnError'
=>
true
,
'targetClass'
=>
User
::
className
(),
'targetAttribute'
=>
[
'owner_id'
=>
'id'
]],
[[
'owner_id'
],
'exist'
,
'skipOnError'
=>
true
,
'targetClass'
=>
User
::
className
(),
'targetAttribute'
=>
[
'owner_id'
=>
'id'
]],
];
];
}
}
// public function checkConditions($attribute, $params){
// var_dump('asd'); die;
// if (!is_array($this->$attribute) || count($this->$attribute)===0) {
// $this->addError($attribute, 'Conditions is empty or has a wrong format');
// return false;
// }
// return false;
// }
/**
/**
* @inheritdoc
* @inheritdoc
*/
*/
...
@@ -62,7 +86,7 @@ class TriggerTrigger extends \yii\db\ActiveRecord
...
@@ -62,7 +86,7 @@ class TriggerTrigger extends \yii\db\ActiveRecord
'date_create'
=>
'Дата создания'
,
'date_create'
=>
'Дата создания'
,
'timeout'
=>
'Задержка перед выполнением (секунд)'
,
'timeout'
=>
'Задержка перед выполнением (секунд)'
,
'message_template_id'
=>
'Шаблон письма'
,
'message_template_id'
=>
'Шаблон письма'
,
'conditions'
=>
'
Шаблон письма
'
,
'conditions'
=>
'
Условия
'
,
];
];
}
}
...
...
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