public function getValue()
    {
        $val = $this->base['value'];

        if (is_array($val)) {
            $posts = array();

            foreach ($val as $p) {
                $posts[] = $this->postFactory->create($this->getPostObject($p));
            }

            return $posts;
        } elseif (strlen($val)) {
            return $this->postFactory->create($this->getPostObject($val));
        } else {
            if (isset($this->base['multiple']) && $this->base['multiple']) {
                return array();
            } else {
                return null;
            }
        }
    }
public function getValue()
    {
        $val = $this->base['value'];

        if (is_array($val)) {
            $posts = array();

            foreach ($val as $p) {
                $posts[] = $this->postFactory->create($this->getPostObject($p));
            }

            return $posts;
        } elseif (strlen($val)) {
            return $this->postFactory->create($this->getPostObject($val));
        } else {
            if (isset($this->base['multiple']) && $this->base['multiple']) {
                return array();
            } else {
                return null;
            }
        }
    }
public function getValue ( ) { $ val = $ this -> base [ 'value' ] ; if ( is_array ( $ val ) ) { $ posts = array ( ) ; foreach ( $ val as $ p ) { $ posts [ ] = $ this -> postFactory -> create ( $ this -> getPostObject ( $ p ) ) ; } return $ posts ; } elseif ( strlen ( $ val ) ) { return $ this -> postFactory -> create ( $ this -> getPostObject ( $ val ) ) ; } else { if ( isset ( $ this -> base [ 'multiple' ] ) && $ this -> base [ 'multiple' ] ) { return array ( ) ; } else { return null ; } } }
Get a single post object or array of post objects.

If no posts are configured, returned will result will be an empty array
if this is a mutli-select, or null if not.

@return \Tev\Post\Model\Post|\Tev\Post\Model\Post[]|null
Get a single post object or array of post objects .