/** * Get node with bound state * * Return an instance of a node with all the properties passed in * <var>$array</var> associative array assigned to it: * * <code> $node = AeNode::__set_state(array( * 'foo' => 'hello', * 'bar' => 'world' * )); * * echo $node->get('foo') . ' ' . $node->get('bar'); // prints "hello world"</code> * * @param array $array an associative array of properties * * @return object|AeNode a resulting node or custom object */ public static function __set_state($array) { if (count($array) > 0) { $node = new AeNode(); $node->bind($array); } return $node; }