public function bind($properties, $updateNulls = true)
	{
		// Check the properties data type.
		if (!\is_array($properties) && !\is_object($properties))
		{
			throw new \InvalidArgumentException(sprintf('%s(%s)', __METHOD__, \gettype($properties)));
		}

		// Check if the object is traversable.
		if ($properties instanceof \Traversable)
		{
			// Convert iterator to array.
			$properties = iterator_to_array($properties);
		}
		elseif (\is_object($properties))
		{
			// Convert properties to an array.
			$properties = (array) $properties;
		}

		// Bind the properties.
		foreach ($properties as $property => $value)
		{
			// Check if the value is null and should be bound.
			if ($value === null && !$updateNulls)
			{
				continue;
			}

			// Set the property.
			$this->setProperty($property, $value);
		}

		return $this;
	}
public function bind($properties, $updateNulls = true)
	{
		// Check the properties data type.
		if (!\is_array($properties) && !\is_object($properties))
		{
			throw new \InvalidArgumentException(sprintf('%s(%s)', __METHOD__, \gettype($properties)));
		}

		// Check if the object is traversable.
		if ($properties instanceof \Traversable)
		{
			// Convert iterator to array.
			$properties = iterator_to_array($properties);
		}
		elseif (\is_object($properties))
		{
			// Convert properties to an array.
			$properties = (array) $properties;
		}

		// Bind the properties.
		foreach ($properties as $property => $value)
		{
			// Check if the value is null and should be bound.
			if ($value === null && !$updateNulls)
			{
				continue;
			}

			// Set the property.
			$this->setProperty($property, $value);
		}

		return $this;
	}
public function bind ( $ properties , $ updateNulls = true ) { // Check the properties data type. if ( ! \ is_array ( $ properties ) && ! \ is_object ( $ properties ) ) { throw new \ InvalidArgumentException ( sprintf ( '%s(%s)' , __METHOD__ , \ gettype ( $ properties ) ) ) ; } // Check if the object is traversable. if ( $ properties instanceof \ Traversable ) { // Convert iterator to array. $ properties = iterator_to_array ( $ properties ) ; } elseif ( \ is_object ( $ properties ) ) { // Convert properties to an array. $ properties = ( array ) $ properties ; } // Bind the properties. foreach ( $ properties as $ property => $ value ) { // Check if the value is null and should be bound. if ( $ value === null && ! $ updateNulls ) { continue ; } // Set the property. $ this -> setProperty ( $ property , $ value ) ; } return $ this ; }
Binds an array or object to this object.

@param   mixed    $properties   An associative array of properties or an object.
@param   boolean  $updateNulls  True to bind null values, false to ignore null values.

@return  DataObject  Returns itself to allow chaining.

@since   1.0
@throws  \InvalidArgumentException
Binds an array or object to this object .