public function onBeforeWrite() {
		parent::onBeforeWrite();

		$has_one = $this->owner->has_one();
		// Loop over each WidgetArea
		foreach ($has_one as $name => $class) {
			if ($class == 'WidgetArea') {
				// Create the WidgetArea if it not exist
				$dbName = $name . 'ID';
				$wa = $this->owner->$name();
				if (!$wa->exists()){
					$this->owner->$dbName = $wa->write();
				}
			}
		}
	}
public function onBeforeWrite() {
		parent::onBeforeWrite();

		$has_one = $this->owner->has_one();
		// Loop over each WidgetArea
		foreach ($has_one as $name => $class) {
			if ($class == 'WidgetArea') {
				// Create the WidgetArea if it not exist
				$dbName = $name . 'ID';
				$wa = $this->owner->$name();
				if (!$wa->exists()){
					$this->owner->$dbName = $wa->write();
				}
			}
		}
	}
public function onBeforeWrite ( ) { parent :: onBeforeWrite ( ) ; $ has_one = $ this -> owner -> has_one ( ) ; // Loop over each WidgetArea foreach ( $ has_one as $ name => $ class ) { if ( $ class == 'WidgetArea' ) { // Create the WidgetArea if it not exist $ dbName = $ name . 'ID' ; $ wa = $ this -> owner -> $ name ( ) ; if ( ! $ wa -> exists ( ) ) { $ this -> owner -> $ dbName = $ wa -> write ( ) ; } } } }
Creates WidgetArea DataObjects in not aleready done.
Creates WidgetArea DataObjects in not aleready done .