WC_Mock_WC_Data::save PHP Method

save() public method

Simple save.
public save ( )
    public function save()
    {
        if ($this->data_store) {
            if ($this->get_id()) {
                $this->data_store->update($this);
            } else {
                $this->data_store->create($this);
            }
        }
        $this->save_meta_data();
        return $this->get_id();
    }

Usage Example

Example #1
0
 /**
  * Create a test user we can add/test meta against.
  */
 public function create_test_user()
 {
     $object = new WC_Mock_WC_Data();
     $object->set_meta_type('user');
     $object->set_object_id_field('user_id');
     $object->set_content('*****@*****.**');
     $object->save();
     return $object;
 }
All Usage Examples Of WC_Mock_WC_Data::save