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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
250ec28e
Commit
250ec28e
authored
Aug 03, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #713.
parent
60ba2049
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
Component.php
framework/yii/base/Component.php
+6
-6
No files found.
framework/yii/base/Component.php
View file @
250ec28e
...
...
@@ -246,15 +246,15 @@ class Component extends Object
*
* @param string $name the property name
* @param boolean $checkVar whether to treat member variables as properties
* @param boolean $checkBehavior whether to treat behaviors' properties as properties of this component
* @param boolean $checkBehavior
s
whether to treat behaviors' properties as properties of this component
* @return boolean whether the property can be read
* @see canSetProperty
*/
public
function
canGetProperty
(
$name
,
$checkVar
=
true
,
$checkBehavior
=
true
)
public
function
canGetProperty
(
$name
,
$checkVar
=
true
,
$checkBehavior
s
=
true
)
{
if
(
method_exists
(
$this
,
'get'
.
$name
)
||
$checkVar
&&
property_exists
(
$this
,
$name
))
{
return
true
;
}
else
{
}
else
if
(
$checkBehaviors
)
{
$this
->
ensureBehaviors
();
foreach
(
$this
->
_behaviors
as
$behavior
)
{
if
(
$behavior
->
canGetProperty
(
$name
,
$checkVar
))
{
...
...
@@ -276,15 +276,15 @@ class Component extends Object
*
* @param string $name the property name
* @param boolean $checkVar whether to treat member variables as properties
* @param boolean $checkBehavior whether to treat behaviors' properties as properties of this component
* @param boolean $checkBehavior
s
whether to treat behaviors' properties as properties of this component
* @return boolean whether the property can be written
* @see canGetProperty
*/
public
function
canSetProperty
(
$name
,
$checkVar
=
true
,
$checkBehavior
=
true
)
public
function
canSetProperty
(
$name
,
$checkVar
=
true
,
$checkBehavior
s
=
true
)
{
if
(
method_exists
(
$this
,
'set'
.
$name
)
||
$checkVar
&&
property_exists
(
$this
,
$name
))
{
return
true
;
}
else
{
}
else
if
(
$checkBehaviors
)
{
$this
->
ensureBehaviors
();
foreach
(
$this
->
_behaviors
as
$behavior
)
{
if
(
$behavior
->
canSetProperty
(
$name
,
$checkVar
))
{
...
...
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