Permalink
Browse files

bug #3791 Property access tweaks (weaverryan)

This PR was merged into the master branch.

Discussion
----------

Property access tweaks

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.5+
| Fixed tickets | #3729

Hi guys!

This follows after #3729 - it includes several small suggestions made by @wouterj and @xabbuh.

Additionally, this removes the 3rd argument to `isWritable`, which was removed in the orignal PR (symfony/symfony#10570) and didn't make it into the final feature.

Thanks!

Commits
-------

fb9fe99 [#3729] Removing 3rd argument to isWritable - this doesn't exist in the final merged item
319bf29 [#3729] Making minor changes thansk to @wouterj and @xabbuh.
  • Loading branch information...
weaverryan committed May 6, 2014
2 parents d6474fc + fb9fe99 commit baa97592f26023828d14d6eb80a2368365d147d0
Showing with 7 additions and 7 deletions.
  1. +7 −7 components/property_access/introduction.rst
@@ -314,12 +314,13 @@ Checking Property Paths
.. versionadded:: 2.5
The methods
:method:`PropertyAccessor::isReadable<Symfony\\Component\\PropertyAccess\\PropertyAccessor::isReadable>`
:method:`PropertyAccessor::isReadable <Symfony\\Component\\PropertyAccess\\PropertyAccessor::isReadable>`
and
:method:`PropertyAccessor::isWritable<Symfony\\Component\\PropertyAccess\\PropertyAccessor::isWritable>`
methods were added in Symfony 2.5.
:method:`PropertyAccessor::isWritable <Symfony\\Component\\PropertyAccess\\PropertyAccessor::isWritable>`
methods were introduced in Symfony 2.5.
When you want to check whether :method:`PropertyAccessor::getValue<Symfony\\Component\\PropertyAccess\\PropertyAccessor::getValue>`
When you want to check whether
:method:`PropertyAccessor::getValue<Symfony\\Component\\PropertyAccess\\PropertyAccessor::getValue>`
can safely be called without actually calling that method, you can use
:method:`PropertyAccessor::isReadable<Symfony\\Component\\PropertyAccess\\PropertyAccessor::isReadable>`
instead::
@@ -333,12 +334,11 @@ instead::
The same is possible for :method:`PropertyAccessor::setValue<Symfony\\Component\\PropertyAccess\\PropertyAccessor::setValue>`:
Call the
:method:`PropertyAccessor::isWritable<Symfony\\Component\\PropertyAccess\\PropertyAccessor::isWritable>`
method to find out whether a property path can be updated. In the third
argument, you should pass the value that you want to write::
method to find out whether a property path can be updated::
$person = new Person();
if ($accessor->isWritable($person, 'firstName', 'Wouter') {
if ($accessor->isWritable($person, 'firstName') {
// ...
}

0 comments on commit baa9759

Please sign in to comment.