get_properties(); foreach ( $properties as $object_property => $new_property ) { if ( isset( $object->{$object_property} ) ) { $this->{"set_$new_property"}( $object->{$object_property} ); } } } } abstract protected function get_properties(); }