protected function writeOnce(&$property, $value)
	{
		$sourceEntity = get_class($this);
		if (empty($value)) {
			$this->unlockAll();
			throw new \RuntimeException("Second argument sent to method	$sourceEntity::writeOnce() cannot be empty");
		}
		if ( ! is_object($value)) {
			$this->unlockAll();
			throw new \RuntimeException("Second argument sent to method $sourceEntity::writeOnce() must be an object");
		}
		if ($property === $value) {
			return false;
		}
		if (! empty($property)) {

			$this->unlockAll();

			throw new \RuntimeException(sprintf(
				"The property [%s] is write-once, cannot rewrite with different value for [%]",
				get_class($value),
				$sourceEntity
			));
		}
		$property = $value;

		return true;
	}
protected function writeOnce(&$property, $value)
	{
		$sourceEntity = get_class($this);
		if (empty($value)) {
			$this->unlockAll();
			throw new \RuntimeException("Second argument sent to method	$sourceEntity::writeOnce() cannot be empty");
		}
		if ( ! is_object($value)) {
			$this->unlockAll();
			throw new \RuntimeException("Second argument sent to method $sourceEntity::writeOnce() must be an object");
		}
		if ($property === $value) {
			return false;
		}
		if (! empty($property)) {

			$this->unlockAll();

			throw new \RuntimeException(sprintf(
				"The property [%s] is write-once, cannot rewrite with different value for [%]",
				get_class($value),
				$sourceEntity
			));
		}
		$property = $value;

		return true;
	}
protected function writeOnce ( & $ property , $ value ) { $ sourceEntity = get_class ( $ this ) ; if ( empty ( $ value ) ) { $ this -> unlockAll ( ) ; throw new \ RuntimeException ( "Second argument sent to method	$sourceEntity::writeOnce() cannot be empty" ) ; } if ( ! is_object ( $ value ) ) { $ this -> unlockAll ( ) ; throw new \ RuntimeException ( "Second argument sent to method $sourceEntity::writeOnce() must be an object" ) ; } if ( $ property === $ value ) { return false ; } if ( ! empty ( $ property ) ) { $ this -> unlockAll ( ) ; throw new \ RuntimeException ( sprintf ( "The property [%s] is write-once, cannot rewrite with different value for [%]" , get_class ( $ value ) , $ sourceEntity ) ) ; } $ property = $ value ; return true ; }
Set the property value. Return true on success, false on equal parameter,
exception when argument not valid or different value was already set
@param mixed $property
@param mixed $value
@return bool
@throws \RuntimeException when trying to rewrite the property
or invalid argument is passed
Set the property value . Return true on success false on equal parameter exception when argument not valid or different value was already set