Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
91444b20
Commit
91444b20
authored
Feb 01, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#2248: Renamed `yii\base\Model::DEFAULT_SCENARIO` to `yii\base\Model::SCENARIO_DEFAULT`
parent
7145b9e9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
Model.php
framework/base/Model.php
+4
-4
No files found.
framework/CHANGELOG.md
View file @
91444b20
...
...
@@ -139,6 +139,7 @@ Yii Framework 2 Change Log
-
Chg #2173: Removed
`StringHelper::diff()`
, Moved
`phpspec/php-diff`
dependency from
`yiisoft/yii2`
to
`yiisoft/yii2-gii`
(samdark)
-
Chg #2175: QueryBuilder will now append UNION statements at the end of the primary SQL (qiangxue)
-
Chg #2210: Mysql driver will now treat
`tinyint(1)`
as integer instead of boolean (qiangxue)
-
Chg #2248: Renamed
`yii\base\Model::DEFAULT_SCENARIO`
to
`yii\base\Model::SCENARIO_DEFAULT`
(samdark)
-
Chg: Renamed
`yii\jui\Widget::clientEventsMap`
to
`clientEventMap`
(qiangxue)
-
Chg: Renamed
`ActiveRecord::getPopulatedRelations()`
to
`getRelatedRecords()`
(qiangxue)
-
Chg: Renamed
`attributeName`
and
`className`
to
`targetAttribute`
and
`targetClass`
for
`UniqueValidator`
and
`ExistValidator`
(qiangxue)
...
...
framework/base/Model.php
View file @
91444b20
...
...
@@ -57,7 +57,7 @@ class Model extends Component implements IteratorAggregate, ArrayAccess, Arrayab
/**
* The name of the default scenario.
*/
const
DEFAULT_SCENARIO
=
'default'
;
const
SCENARIO_DEFAULT
=
'default'
;
/**
* @event ModelEvent an event raised at the beginning of [[validate()]]. You may set
...
...
@@ -80,7 +80,7 @@ class Model extends Component implements IteratorAggregate, ArrayAccess, Arrayab
/**
* @var string current scenario
*/
private
$_scenario
=
self
::
DEFAULT_SCENARIO
;
private
$_scenario
=
self
::
SCENARIO_DEFAULT
;
/**
* Returns the validation rules for attributes.
...
...
@@ -178,7 +178,7 @@ class Model extends Component implements IteratorAggregate, ArrayAccess, Arrayab
*/
public
function
scenarios
()
{
$scenarios
=
[
self
::
DEFAULT_SCENARIO
=>
[]];
$scenarios
=
[
self
::
SCENARIO_DEFAULT
=>
[]];
foreach
(
$this
->
getValidators
()
as
$validator
)
{
foreach
(
$validator
->
on
as
$scenario
)
{
$scenarios
[
$scenario
]
=
[];
...
...
@@ -214,7 +214,7 @@ class Model extends Component implements IteratorAggregate, ArrayAccess, Arrayab
}
foreach
(
$scenarios
as
$scenario
=>
$attributes
)
{
if
(
empty
(
$attributes
)
&&
$scenario
!==
self
::
DEFAULT_SCENARIO
)
{
if
(
empty
(
$attributes
)
&&
$scenario
!==
self
::
SCENARIO_DEFAULT
)
{
unset
(
$scenarios
[
$scenario
]);
}
else
{
$scenarios
[
$scenario
]
=
array_keys
(
$attributes
);
...
...
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