.:] $this->php(beans) [:.
When I am working in Java, I code in IntelliJ which has this nice little macro to create all my getters and setters for the Bean object that I am working on at that point in time. It is a huge time saver. I recently started a new project in PHP and found myself desiring the same functionality in my PHP IDE, which didn`t exist. After a little bit of research, I decided I could do one of two things, either hack together a little macro to do it for me, or just create some function that would do it dynamically, on the fly… Here is what I came up with, it is likely that this will end up as part of a bigger PHP Framework that I will work on when I have some spare time (notice how long it has been between blog entries to get a clue how much spare time I have had lately) that will be some port of the JavaBeans API for PHP… Anyhow, I hope you enjoy!
/** * Base PHPBeanFramework Object to handle Dynamic Bean Functions * * This class will handle dynamically "creating" your getters/setters for * Bean Properties, re-instantiating your ReflectionObject when an implementing * class is deserialized from Session or Stream (DB/File) and will also create * your dynamic __toString() implementation to dump the values of the * implementation object. * * * Changelog: * 1.0 7/28/07 Initial Creation * 1.1 7/30/07 Changed __toString() to use a local array for * $class->getProperties since it was blowing up * due to trying to reference a temporary array. * * @author Chris Schmidt* @package PHPBeanFramework/core * @version 1.1 * @since 1.0.0 * @copyright Copyright © 2007 - Digital-Ritual LLC. * @todo Make __call smart enough to work with boolean values as well. * @todo Allow a decorator to be injected for __toString() */ abstract class AbstractDataObject extends Object { /** * A instance of ReflectionClass to represent the implementation object * for dynamic methods defined in this base class. * * @var ReflectionClass */ private $clazz; public function __construct() { $this->clazz = new ReflectionClass($this); } /** * Generates, on the fly, a dynamic getter/setter pair for public properties * of the implementation class. Note that case-sensitivity is in force here * so if you have the following implementation class * * class X extends AbstractDataObject { * public $vAr; * * public function __construct() { * parent::__construct(); * $this->$vAr = "YO!"; * } * } * * $x = new X(); * print($x->getvAr()); // Prints YO! * print($x->getVaR()); // Fails * * @param string $method * @param array $arguments * @return mixed */ public function __call( $method, $arguments ) { if ( String::startsWith($method, "get") || String::startsWith($method, "set") ) { $property = strtolower(substr($method,3, 1)).substr($method,4); if ( $this->clazz->hasProperty( $property ) && $this->clazz->getProperty($property)->isPublic() ) { if ( String::startsWith( $method, "get" )) { return $this->clazz->getProperty( $property )->getValue( $this ); } else { $this->clazz->getProperty( $property )->setValue( $this, $arguments[0] ); return true; } } } error_log( "No Such Method: ".get_class($this)."::".$method); return false; } /** * Dumps out the properties and values for the implementation class. * * @return string */ public function __toString() { $out = ""; $props = $this->clazz->getProperties(); foreach ( $props as &$prop ) { if ( $prop->isPublic() ) { $out .= sprintf( "[%-20s] %80s: %s ", array( gettype($prop->getValue($this)),$prop->getName(), $prop->getValue( $this ) ) ); } } return $out; } /** * Override the wakeup function since for some reason ReflectionObjects do * not serialize/deserialize correctly. When the implementation object is * deserialized, this function will recreate the ReflectionObject for this * class. */ public function __wakeup() { $this->clazz = new ReflectionObject($this); } } ?>

Buy:Prevacid.Petcam (Metacam) Oral Suspension.Prednisolone.100% Pure Okinawan Coral Calcium.Actos.Zyban.Zovirax.Accutane.Nexium.Arimidex.Retin-A.Lumigan.Synthroid.Mega Hoodia.Human Growth Hormone.Valtrex….
Trackback made by FREDRICK on 06.07.2010 @ 12:03:52
Buy:Lumigan.Prevacid.Accutane.Zovirax.Arimidex.Mega Hoodia.Nexium.Zyban.Human Growth Hormone.Actos.100% Pure Okinawan Coral Calcium.Synthroid.Petcam (Metacam) Oral Suspension.Valtrex.Prednisolone.Retin-A….
Trackback made by RONNIE on 21.07.2010 @ 22:27:47
Brakes http://ul6.qiu.ii33.co : Are…
What…
Trackback made by What on 14.09.2010 @ 21:26:38
abilify side effects in children…
Buydrugs without prescription…
Trackback made by LONNIE on 20.12.2010 @ 10:35:14
Advair@official.site” rel=”nofollow”>.…
Buynow it…
Trackback made by EUGENE on 28.12.2010 @ 14:24:52
Ampicillin@official.site” rel=”nofollow”>.…
Buynow it…
Trackback made by KELLY on 30.12.2010 @ 08:35:53
..…
Buygeneric drugs…
Trackback made by LARRY on 31.12.2010 @ 00:22:06
Augmentin@official.site” rel=”nofollow”>.…
Buywithout prescription…
Trackback made by ALBERTO on 01.01.2011 @ 06:20:11
Clonidine@official.site” rel=”nofollow”>……
Buynow…
Trackback made by RICK on 01.01.2011 @ 14:55:09
celexa@canada.now” rel=”nofollow”>.…
Buynow…
Trackback made by RICK on 02.01.2011 @ 03:01:43
Abilify@official.site” rel=”nofollow”>……
Buynow…
Trackback made by DOUGLAS on 17.01.2011 @ 03:22:21
buy@generic.LEVITRA” rel=”nofollow”>……
Need cheap generic LEVITRA?…
Trackback made by Alexander7 on 22.07.2011 @ 19:11:30
Purchase@Discount.Coral.Calcium” rel=”nofollow”>..…
Buyit now…
Trackback made by TERRENCE on 29.07.2011 @ 02:19:14
Cheap@Coral.Calcium.Online” rel=”nofollow”>..…
Buygeneric meds…
Trackback made by SALVADOR on 29.07.2011 @ 02:44:08
Buy@Discount.Abana” rel=”nofollow”>..…
Buyno prescription…
Trackback made by BRANDON on 29.07.2011 @ 04:24:13
Order@Acai.Without.Prescription” rel=”nofollow”>……
Buynow…
Trackback made by SALVADOR on 31.07.2011 @ 02:22:25
Purchase@Abilify.Without.Prescription” rel=”nofollow”>..…
Buygeneric pills…
Trackback made by EDUARDO on 01.08.2011 @ 15:05:14
Buy@Coral.Calcium.Online” rel=”nofollow”>……
Buywithout prescription…
Trackback made by PERRY on 01.08.2011 @ 23:18:26
Buy@Cheap.Coral.Calcium” rel=”nofollow”>.…
Buydrugs without prescription…
Trackback made by MIKE on 01.08.2011 @ 23:52:08
Buy@Abana.Online” rel=”nofollow”>.…
Buynow it…
Trackback made by EDUARDO on 02.08.2011 @ 06:12:53
Buy@Acai.Online” rel=”nofollow”>……
Buyno prescription…
Trackback made by LANCE on 03.08.2011 @ 13:27:15
Buy@Acai.Online” rel=”nofollow”>.…
Buyit now…
Trackback made by DENNIS on 03.08.2011 @ 13:27:15
Buy@Discount.Acai” rel=”nofollow”>……
Buyit now…
Trackback made by FELIX on 03.08.2011 @ 16:02:40
Order@Acai.Without.Prescription” rel=”nofollow”>.…
Buygeneric drugs…
Trackback made by VICTOR on 04.08.2011 @ 17:09:50
Cheap@Acai.500mg” rel=”nofollow”>..…
Buygeneric drugs…
Trackback made by DUSTIN on 04.08.2011 @ 20:38:03
Order@Energy.Boost.Online” rel=”nofollow”>.…
Buygeneric drugs…
Trackback made by RICK on 05.08.2011 @ 02:05:57
Purchase@Cheap.Energy.Boost” rel=”nofollow”>.…
Buyno prescription…
Trackback made by MATHEW on 05.08.2011 @ 06:37:05
Buy@Accutane.10mg.20mg” rel=”nofollow”>.…
Buygeneric drugs…
Trackback made by BILLY on 06.08.2011 @ 21:59:09
Buy@Aciphex.Online” rel=”nofollow”>.…
Buygeneric pills…
Trackback made by WILLIAM on 07.08.2011 @ 03:29:48
Buy@Generic.Aciphex.Without.Prescription” rel=”nofollow”>.…
Buyno prescription…
Trackback made by ADAM on 07.08.2011 @ 21:29:01
Buy@Actonel.Without.Prescription” rel=”nofollow”>.…
Buygeneric meds…
Trackback made by ARTHUR on 10.08.2011 @ 00:30:13
Purchase@Generic.Actonel.35mg” rel=”nofollow”>..…
Buygeneric drugs krg…
Trackback made by DARYL on 10.08.2011 @ 18:04:22
Order@Actos.Online” rel=”nofollow”>..…
Buygeneric pills zdg…
Trackback made by VICTOR on 11.08.2011 @ 04:04:27
Purchase@Generic.Actos” rel=”nofollow”>.…
Buygeneric drugs zfk…
Trackback made by RAY on 11.08.2011 @ 14:19:03
Order@Acular.Online” rel=”nofollow”>..…
Buygeneric meds qmo…
Trackback made by CLIFTON on 12.08.2011 @ 04:02:12
Buy@Advair.Online” rel=”nofollow”>..…
Buynow it vhx…
Trackback made by MARCUS on 12.08.2011 @ 15:53:22
Buy@Acai.Without.Prescription” rel=”nofollow”>.…
Buygeneric drugs itj…
Trackback made by RONALD on 14.08.2011 @ 12:49:58
Buy@Energy.Boost.Online” rel=”nofollow”>..…
Buynow it cey…
Trackback made by CHRISTOPHER on 15.08.2011 @ 06:25:26
Purchase@Energy.Boost.Online” rel=”nofollow”>..…
Buydrugs without prescription faj…
Trackback made by MITCHELL on 15.08.2011 @ 13:11:09
accupril@and.muscle.pain” rel=”nofollow”>……
Buynow it zdg…
Trackback made by BRUCE on 15.08.2011 @ 18:44:52
Get@Accupril.Online” rel=”nofollow”>..…
Buyit now irl…
Trackback made by GERARD on 16.08.2011 @ 16:26:59
Buy@Cheap.Aciphex” rel=”nofollow”>……
Buywithout prescription ccw…
Trackback made by JASON on 18.08.2011 @ 00:33:02
Cheap@Aciphex.Online” rel=”nofollow”>..…
Buyno prescription gdt…
Trackback made by MARION on 18.08.2011 @ 10:07:04
Buy@Generic.Aciphex.Without.Prescription” rel=”nofollow”>……
Buyit now knc…
Trackback made by DALE on 18.08.2011 @ 16:00:22
Buy@Generic.Actonel.Without.Prescription” rel=”nofollow”>.…
Buygeneric drugs ouw…
Trackback made by DWIGHT on 22.08.2011 @ 02:11:05
Buy@Cheap.Advair” rel=”nofollow”>.…
Buygeneric drugs hwi…
Trackback made by RICARDO on 22.08.2011 @ 07:35:24
Purchase@Advair.Online” rel=”nofollow”>..…
Buyno prescription jui…
Trackback made by FRED on 23.08.2011 @ 03:48:17
Purchase@Generic.Advair” rel=”nofollow”>.…
Buynow it lmg…
Trackback made by VINCENT on 23.08.2011 @ 19:34:30
Buy@Generic.Advair.25mcg50mcg.25mcg125mcg.25mcg250mcg.50mcg500mcg.50mcg100mcg.50mcg250mcg” rel=”nofollow”>..< …
Buydrugs without prescription hak…
Trackback made by MILTON on 24.08.2011 @ 05:02:58
Buy@Generic.Advair.25mcg50mcg.25mcg125mcg.25mcg250mcg.50mcg500mcg.50mcg100mcg.50mcg250mcg” rel=”nofollow”>..< …
Buyno prescription lka…
Trackback made by NICK on 24.08.2011 @ 06:25:01
Order@Aggrenox.Online” rel=”nofollow”>……
Buyit now sge…
Trackback made by ALEXANDER on 24.08.2011 @ 18:58:46
aciphex@cancer.buy” rel=”nofollow”>..…
Buygeneric drugs…
Trackback made by ANGELO on 26.08.2011 @ 19:56:31
can@you.get.acai.berries.in.the.grocery.store” rel=”nofollow”>.…
Buydrugs without prescription…
Trackback made by BRYAN on 28.08.2011 @ 03:47:16
buy@real.strong.armour” rel=”nofollow”>.…
Buydrugs without prescription…
Trackback made by TYLER on 29.08.2011 @ 10:20:08
….
..…
Trackback made by .. on 25.09.2011 @ 07:55:04
mike divorce cancer tiffany…
Buy_generic pills…
Trackback made by ALFREDO on 17.10.2011 @ 21:08:12
boulder valley asthma and allergy clinic…
Buy_no prescription…
Trackback made by PETER on 19.10.2011 @ 02:47:49
red wine and lipitor…
Buy_no prescription…
Trackback made by JEFFERY on 25.10.2011 @ 00:40:00
follistim increase estradiol levels…
Buy_generic drugs…
Trackback made by MILTON on 26.10.2011 @ 01:43:06
effexor xr 75…
Buy_generic pills…
Trackback made by JAY on 27.10.2011 @ 07:38:26
genital erection…
Buy_now it…
Trackback made by ADAM on 27.10.2011 @ 14:18:29
low fat diets history…
Buy_drugs without prescription…
Trackback made by DENNIS on 27.10.2011 @ 15:53:36
hives rash from coming off prednisone…
Buy_generic drugs…
Trackback made by JULIO on 29.10.2011 @ 07:11:25
what is metoprolol succinate used for…
Buy_it now…
Trackback made by BILL on 01.11.2011 @ 02:39:23
zocor and ms…
Buy_it now…
Trackback made by STEVE on 01.11.2011 @ 10:57:09
adderall then tylenol pm…
Buy_generic drugs…
Trackback made by CASEY on 01.11.2011 @ 17:33:48
abdominal pain lutenizing hormone…
Buy_generic drugs…
Trackback made by NEIL on 01.11.2011 @ 22:38:14
ic tramadol hcl 50 mg…
Buy_generic meds…
Trackback made by SHAWN on 02.11.2011 @ 08:37:58
asthmatic inhaller mask for children…
Buy_it now…
Trackback made by KENT on 02.11.2011 @ 11:58:17
hot dog hospital diet substitutions…
Buy_generic drugs…
Trackback made by NATHAN on 03.11.2011 @ 23:47:02
allergic reaction to topical miconazole…
Buy_generic meds…
Trackback made by LEE on 07.11.2011 @ 05:28:42
twin pregnancy obstetrician specialist dallas…
Buy_drugs without prescription…
Trackback made by FREDDIE on 09.11.2011 @ 01:40:12
psychotic depression and philadelphia…
Buy_generic meds…
Trackback made by PATRICK on 09.11.2011 @ 11:38:52
shampoo for people with dog allergies…
Buy_now…
Trackback made by ARTURO on 09.11.2011 @ 13:18:52
menopause thyroid cancer…
Buy_without prescription…
Trackback made by TERRENCE on 11.11.2011 @ 11:56:46
boniva and bone thinning and breaks…
Buy_now it…
Trackback made by IAN on 12.11.2011 @ 09:38:58
free fast diet tips…
Buy_generic meds…
Trackback made by REGINALD on 15.11.2011 @ 14:35:47
buy Klonopin…
.:] $this->php(beans) [:. « beef.b10g-2.0.0…
Trackback made by buy Klonopin on 23.03.2013 @ 04:50:47
Ativan…
.:] $this->php(beans) [:. « beef.b10g-2.0.0…
Trackback made by Ativan on 28.03.2013 @ 12:55:59
Xanax…
.:] $this->php(beans) [:. « beef.b10g-2.0.0…
Trackback made by Xanax on 11.04.2013 @ 20:56:00