public function init($data = null)
    {
        if ($this->initialized) {
            return $this;
        }

        if (is_null($data)) {
            $data = $this->fetchData();
        }

        if ($this->isInitialized($data)) {
            $this->initialized = true;
        }

        $this->data = $data;
        if ($this->initialized) {
            $this->onData($data);
        }

        return $this;
    }
public function init($data = null)
    {
        if ($this->initialized) {
            return $this;
        }

        if (is_null($data)) {
            $data = $this->fetchData();
        }

        if ($this->isInitialized($data)) {
            $this->initialized = true;
        }

        $this->data = $data;
        if ($this->initialized) {
            $this->onData($data);
        }

        return $this;
    }
public function init ( $ data = null ) { if ( $ this -> initialized ) { return $ this ; } if ( is_null ( $ data ) ) { $ data = $ this -> fetchData ( ) ; } if ( $ this -> isInitialized ( $ data ) ) { $ this -> initialized = true ; } $ this -> data = $ data ; if ( $ this -> initialized ) { $ this -> onData ( $ data ) ; } return $ this ; }
Load data onto this object. Chainable method.

@param \stdClass|QuiteSimpleXMLElement $data

@return $this
Load data onto this object . Chainable method .