Hints of blue, the little brother of Not so perfect orange fractal.

Download the full image at a whopping resolution of 5906×5906 pixels from deviantArt, or buy it over there as a print on paper or canvas in a frame or without a frame, looks great with a Lustre finish.

This content is published under the Attribution-Share Alike 3.0 Unported license.

Tagged with:
 

Done by digital manual labour, duplicating everything by hand in order to create a fractal that is flawed but looks good at first glance. Everything has flaws, even fractals.

Download the full image at a whopping resolution of 5906×5906 pixels from deviantArt, or buy it over there as a print on paper or canvas in a frame or without a frame, looks great with a Lustre finish.

This content is published under the Attribution-Share Alike 3.0 Unported license.

Tagged with:
 

PHP recommends making accessor/mutator functions available in a java style manner. This means that you will have to use $myObjects->getMyProperty(); every time you need to. To improve readability and make us type a bit less, you’d obviously just want to use $myObjects->myProperty.
The following code makes this possible by using PHP’s magic functions __get and __set.

< ?php
/**
 * Define accessor and mutator functions for objects using object overloading
 * with magic __get and __set functions as documented at the PHP Documentation page below.
 * 
 * Your objects should derive from this class before using this syntax.
 * Default php convention for accessor and mutator syntax follows the java guidelines 
 * for getPropertyName and setPropertyName, because this matches our naming convention
 * your functions should be formatted like this.
 * 
 * <code>
 * 	< ?php
 * 		class MyFunkyObject extends AccessorMutator
 * 		{
 * 			protected $mMyNonExistentProperty;
 * 			protected $mUseCounter = 0;
 * 
 * 			public function getMyNonExistentProperty() { return $this->mMyNonExistentProperty; }
 * 			public function setMyNonExistentProperty($aValue)
 * 			{
 * 				$this->mMyNonExistentProperty = $aValue;
 * 				$this->mUseCounter++;
 * 			}
 * 		}
 * 
 * 		$myFunkyObject = new MyFunkyObject();
 * 		$myFunkyObject->myNonExistentProperty = "Neu am Kino";
 * 		echo $myFunkyObject->myNonExistentProperty;
 * 	?>
 * 
 * 
 * @author Martijn de Boer / http://cc.sexybiggetje.nl
 * @see http://www.php.net/manual/en/book.overload.php
 * @license http://creativecommons.org/licenses/by-sa/3.0/
 */
 
class AccessorMutator
{
	/**
	 * Make the accessor function available using object overloading in a java style
	 * accessor function following the camelcasing guideline from our styleguide.
	 * 
	 * @param string $aPropertyName
	 * @return object
	 */
	public function __get($aPropertyName)
	{
		$theFunctionName = "get" . ucFirst($aPropertyName);
		if (method_exists($this, $theFunctionName))
			return $this->{$theFunctionName}();
 
		throw(new Exception("No accessor method defined for '" . $aPropertyName . "', did you forget to define " . $theFunctionName . "?"));
	}
 
	/**
	 * Make the mutator function available using object overloading in a java style
	 * mutator function following the camelcasing guideline from our styleguide.
	 * 
	 * @param string $aPropertyName
	 * @param string $aPropertyValue
	 * @return null
	 */
	public function __set($aPropertyName, $aPropertyValue)
	{
		$theFunctionName = "set" . ucfirst($aPropertyName);
		if (method_exists($this, $theFunctionName))
			return $this->{$theFunctionName}($aPropertyValue);
 
		throw(new Exception("No mutator method defined for '" . $aPropertyName . "', did you forget to define " . $theFunctionName . "(\$aValue)?"));
	}
 
}
?>

This content is published under the Attribution-Share Alike 3.0 Unported license.

Tagged with: