# getters/setters project

- Thread: https://externals.io/message/57476
- Original archive: https://news-web.php.net/php.internals/57476
- Started by Christoph Rosse on 2012-01-23T08:10:48+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #57476 — Christoph Rosse — 2012-01-23T08:10:48+00:00

URL: https://externals.io/message/57476#57476

Hi,

I did not follow the whole getter / setter discussion completely and 
just have read the RFC 
https://wiki.php.net/rfc/propertygetsetsyntax-as-implemented .

I just wanted to know if the new getter/setter syntax will provide 
getter/setter methods as well, so I can use fluent-interfaces?

$foo->setBar("a")->doSomething();

Or will I have to write getter / setter methods myself if I want to do this?

Thanks,
christoph

---

## #57480 — Clint M Priest — 2012-01-23T14:21:48+00:00

URL: https://externals.io/message/57476#57480 · In reply to: #57476

Your code example below (with an appropriate getter written) would become:

$foo->__setBar('a')->doSomething() and would work if you return $this at the end of each of your setters.

-----Original Message-----
From: Christoph Rosse [mailto:cr@okto.tv] 
Sent: Monday, January 23, 2012 2:11 AM
To: internals@lists.php.net
Subject: [PHP-DEV] getters/setters project

Hi,

I did not follow the whole getter / setter discussion completely and just have read the RFC https://wiki.php.net/rfc/propertygetsetsyntax-as-implemented .

I just wanted to know if the new getter/setter syntax will provide getter/setter methods as well, so I can use fluent-interfaces?

$foo->setBar("a")->doSomething();

Or will I have to write getter / setter methods myself if I want to do this?

Thanks,
christoph
