@@ -525,19 +525,19 @@ Then, using the overriden methods is automatic:
525
525
// will return 'Hello John Doe'
526
526
527
527
You can also associate a particular method with an operation on a property
528
- using the `@Getter `, `@Setter `, `@Adder ` and ` @Remover ` annotations. All of them
529
- take only one parameter: `property `.
528
+ using the `@PropertyGetter `, `@PropertySetter `, `@PropertyAdder ` and
529
+ ` @PropertyRemover ` annotations. All of them take only one parameter: `property `.
530
530
531
531
This allows creating virtual properties that are not directly stored in the
532
- object::
532
+ object:
533
533
534
534
.. configuration-block ::
535
535
536
536
.. code-block :: php
537
537
538
538
// ...
539
- use Symfony\Component\PropertyAccess\Annotation\Getter ;
540
- use Symfony\Component\PropertyAccess\Annotation\Setter ;
539
+ use Symfony\Component\PropertyAccess\Annotation\PropertyGetter ;
540
+ use Symfony\Component\PropertyAccess\Annotation\PropertySetter ;
541
541
542
542
class Invoice
543
543
{
@@ -548,15 +548,16 @@ object::
548
548
// Notice that there is no real "total" property
549
549
550
550
/**
551
- * @Getter (property="total")
551
+ * @PropertyGetter (property="total")
552
552
*/
553
553
public function getTotal()
554
554
{
555
555
return $this->quantity * $this->pricePerUnit;
556
556
}
557
557
558
+ // Notice that 'property' can be omitted in the parameter
558
559
/**
559
- * @Setter(property= "total")
560
+ * @PropertySetter( "total")
560
561
*
561
562
* @param mixed $total
562
563
*/
0 commit comments