PrivateBin\Model\Paste::store PHP Method

store() public method

Store the paste's data.
public store ( ) : void
return void
    public function store()
    {
        // Check for improbable collision.
        if ($this->exists()) {
            throw new Exception('You are unlucky. Try again.', 75);
        }
        $this->_data->meta->postdate = time();
        $this->_data->meta->salt = serversalt::generate();
        // store paste
        if ($this->_store->create($this->getId(), json_decode(json_encode($this->_data), true)) === false) {
            throw new Exception('Error saving paste. Sorry.', 76);
        }
    }