Phalcon\Db\Adapter\MongoDB\Exception\BadMethodCallException::unacknowledgedWriteResultAccess PHP Method

unacknowledgedWriteResultAccess() public static method

Thrown when accessing a result field on an unacknowledged write result.
public static unacknowledgedWriteResultAccess ( string $method ) : self
$method string Method name
return self
    public static function unacknowledgedWriteResultAccess($method)
    {
        return new static(sprintf('%s should not be called for an unacknowledged write result', $method));
    }

Usage Example

Example #1
0
 /**
  * Return the number of documents that were inserted.
  *
  * This method should only be called if the write was acknowledged.
  *
  * @see InsertManyResult::isAcknowledged()
  * @return integer
  * @throws BadMethodCallException is the write result is unacknowledged
  */
 public function getInsertedCount()
 {
     if ($this->isAcknowledged) {
         return $this->writeResult->getInsertedCount();
     }
     throw BadMethodCallException::unacknowledgedWriteResultAccess(__METHOD__);
 }
All Usage Examples Of Phalcon\Db\Adapter\MongoDB\Exception\BadMethodCallException::unacknowledgedWriteResultAccess