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

classIsImmutable() public static method

Thrown when a mutable method is invoked on an immutable object.
public static classIsImmutable ( string $class ) : self
$class string Class name
return self
    public static function classIsImmutable($class)
    {
        return new static(sprintf('%s is immutable', $class));
    }

Usage Example

Example #1
0
 /**
  * Not supported.
  *
  * @see http://php.net/arrayaccess.offsetunset
  * @throws BadMethodCallException
  */
 public function offsetUnset($key)
 {
     throw BadMethodCallException::classIsImmutable(__CLASS__);
 }