Skip to content

Commit d0d5591

Browse files
committed
Added 'Property' prefix to method annotations
1 parent 8763757 commit d0d5591

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

components/property_access/introduction.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -472,19 +472,19 @@ Then, using the overriden methods is automatic:
472472
// will return 'Hello John Doe'
473473
474474
You can also associate a particular method with an operation on a property
475-
using the `@Getter`, `@Setter`, `@Adder` and `@Remover` annotations. All of them
476-
take only one parameter: `property`.
475+
using the `@PropertyGetter`, `@PropertySetter`, `@PropertyAdder` and
476+
`@PropertyRemover` annotations. All of them take only one parameter: `property`.
477477

478478
This allows creating virtual properties that are not directly stored in the
479-
object::
479+
object:
480480

481481
.. configuration-block::
482482

483483
.. code-block:: php
484484
485485
// ...
486-
use Symfony\Component\PropertyAccess\Annotation\Getter;
487-
use Symfony\Component\PropertyAccess\Annotation\Setter;
486+
use Symfony\Component\PropertyAccess\Annotation\PropertyGetter;
487+
use Symfony\Component\PropertyAccess\Annotation\PropertySetter;
488488
489489
class Invoice
490490
{
@@ -495,15 +495,16 @@ object::
495495
// Notice that there is no real "total" property
496496
497497
/**
498-
* @Getter(property="total")
498+
* @PropertyGetter(property="total")
499499
*/
500500
public function getTotal()
501501
{
502502
return $this->quantity * $this->pricePerUnit;
503503
}
504504
505+
// Notice that 'property' can be omitted in the parameter
505506
/**
506-
* @Setter(property="total")
507+
* @PropertySetter("total")
507508
*
508509
* @param mixed $total
509510
*/

0 commit comments

Comments
 (0)