$value ) { $this->$key = $value; } } public function getState() { return array( "id" => $this->id, "name" => $this->name, ); } public static function __set_state( array $state ) { $employer = new RelationTestEmployer(); foreach ( $state as $key => $value ) { $employer->$key = $value; } return $employer; } } ?>