public function save()
    {
        if ($this->isBound()) {

            if (!isset($this->post_type)) {
                $this->post_type = $this->getWordpressKey();
            }

            if (!isset($this->ping_status)) {
                $this->ping_status = false;
            }

            if (!isset($this->comment_status)) {
                $this->comment_status = false;
            }

            if (!isset($this->ID)) {
                $this->ID = '';
            }

            if ((int)$this->ID > 0) {
                return wp_update_post($this->associatedObject);
            }

            $id = wp_insert_post($this->associatedObject);

            if ((int)$id > 0) {
                $this->ID = $id;
                return true;
            }
        }

        return false;
    }
public function save()
    {
        if ($this->isBound()) {

            if (!isset($this->post_type)) {
                $this->post_type = $this->getWordpressKey();
            }

            if (!isset($this->ping_status)) {
                $this->ping_status = false;
            }

            if (!isset($this->comment_status)) {
                $this->comment_status = false;
            }

            if (!isset($this->ID)) {
                $this->ID = '';
            }

            if ((int)$this->ID > 0) {
                return wp_update_post($this->associatedObject);
            }

            $id = wp_insert_post($this->associatedObject);

            if ((int)$id > 0) {
                $this->ID = $id;
                return true;
            }
        }

        return false;
    }
public function save ( ) { if ( $ this -> isBound ( ) ) { if ( ! isset ( $ this -> post_type ) ) { $ this -> post_type = $ this -> getWordpressKey ( ) ; } if ( ! isset ( $ this -> ping_status ) ) { $ this -> ping_status = false ; } if ( ! isset ( $ this -> comment_status ) ) { $ this -> comment_status = false ; } if ( ! isset ( $ this -> ID ) ) { $ this -> ID = '' ; } if ( ( int ) $ this -> ID > 0 ) { return wp_update_post ( $ this -> associatedObject ) ; } $ id = wp_insert_post ( $ this -> associatedObject ) ; if ( ( int ) $ id > 0 ) { $ this -> ID = $ id ; return true ; } } return false ; }
Saves the model entity the current post type based on the
associated object's values.
@return boolean Whether something was updated
Saves the model entity the current post type based on the associated object s values .