src/PayloadBuilders/EntryField.php
protected function parseContent($content) {
        if(is_bool($content)) {
            $this->addLanguage($this->language, $content);
            return;
        }
        if (!$content) {
            return;
        }
        if (is_string($content)) {
            $this->addLanguage($this->language, $content);
            return;
        }
        foreach($content as $key => $data) {
            if (!empty($data[0]['sys']['linkType'])) {
                foreach($data as $link) {
                    $this->addLink($link['id'], $link['linkType'], $key);
                }
            } else {
                if (is_numeric($key)) {
                    $this->addLanguage($this->language, [$data]);
                } else {
                    $this->addLanguage($key, $data);
                }
            }
        }
    }
protected function parseContent($content) {
        if(is_bool($content)) {
            $this->addLanguage($this->language, $content);
            return;
        }
        if (!$content) {
            return;
        }
        if (is_string($content)) {
            $this->addLanguage($this->language, $content);
            return;
        }
        foreach($content as $key => $data) {
            if (!empty($data[0]['sys']['linkType'])) {
                foreach($data as $link) {
                    $this->addLink($link['id'], $link['linkType'], $key);
                }
            } else {
                if (is_numeric($key)) {
                    $this->addLanguage($this->language, [$data]);
                } else {
                    $this->addLanguage($key, $data);
                }
            }
        }
    }
protected function parseContent ( $ content ) { if ( is_bool ( $ content ) ) { $ this -> addLanguage ( $ this -> language , $ content ) ; return ; } if ( ! $ content ) { return ; } if ( is_string ( $ content ) ) { $ this -> addLanguage ( $ this -> language , $ content ) ; return ; } foreach ( $ content as $ key => $ data ) { if ( ! empty ( $ data [ 0 ] [ 'sys' ] [ 'linkType' ] ) ) { foreach ( $ data as $ link ) { $ this -> addLink ( $ link [ 'id' ] , $ link [ 'linkType' ] , $ key ) ; } } else { if ( is_numeric ( $ key ) ) { $ this -> addLanguage ( $ this -> language , [ $ data ] ) ; } else { $ this -> addLanguage ( $ key , $ data ) ; } } } }
Parse loaded content. Tests to see if it's a link or if languages are provided and handle appropriately.
@param $content
Parse loaded content . Tests to see if it s a link or if languages are provided and handle appropriately .