@param \Riak\Client\Core\Query\Crdt\Op\FlagOp $op

@return integer
8694
protected function convertFlag(Op\FlagOp $op)
    {
        return $op->isEnabled()
            ? ProtoBuf\MapUpdate\FlagOp::ENABLE
            : ProtoBuf\MapUpdate\FlagOp::DISABLE;
    }
576416
public function scopeWithToken($query, $flag = true)
    {
        if (! isset($this->DT_Column)) {
            $this->DT_Column = $this->defaultColumn;
        }

        if ($flag) {
            return $query->where($this->DT_Column, '!=', null);
        } else {
            return $query->where($this->DT_Column, '=', null);
        }
    }
420695
public static String operatorToString(int op) {
        String result = operatorNames.get(op);
        if (result == null)
            throw new IllegalArgumentException("Invalid operator: " + op);
        return result;
    }
1155844
protected function opColorColor($op, $left, $right)
    {
        $out = [Type::T_COLOR];

        foreach ([1, 2, 3] as $i) {
            $lval = isset($left[$i]) ? $left[$i] : 0;
            $rval = isset($right[$i]) ? $right[$i] : 0;

            switch ($op) {
                case '+':
                    $out[] = $lval + $rval;
                    break;

                case '-':
                    $out[] = $lval - $rval;
                    break;

                case '*':
                    $out[] = $lval * $rval;
                    break;

                case '%':
                    $out[] = $lval % $rval;
                    break;

                case '/':
                    if ($rval == 0) {
                        $this->throwError("color: Can't divide by zero");
                        break 2;
                    }

                    $out[] = (int) ($lval / $rval);
                    break;

                case '==':
                    return $this->opEq($left, $right);

                case '!=':
                    return $this->opNeq($left, $right);

                default:
                    $this->throwError("color: unknown op $op");
                    break 2;
            }
        }

        if (isset($left[4])) {
            $out[4] = $left[4];
        } elseif (isset($right[4])) {
            $out[4] = $right[4];
        }

        return $this->fixColor($out);
    }
1252931
public function max($op)
  {
    $op = $this->same($op, $this->prec);
    return $this->gt($op) ? clone $this : $op;
  }
862010
protected function convertCounter(Op\CounterOp $op)
    {
        $counterOp = new ProtoBuf\CounterOp();
        $increment = $op->getIncrement();

        $counterOp->setIncrement($increment);

        return $counterOp;
    }
624883
public function pow($op)
  {
    $dst = clone $this;
    $op = $this->same($op, $this->prec)->truncate();
    $dst->value = $this->_fix($this->_pow($op));
    return $dst;
  }
503616
public function awaitOperation(Operation $operation, $interval = 5)
    {
        while ($operation->getState() == OperationState::InProgress) {
            $operation = $this->getOperation($operation);
            if ($operation->getState() == OperationState::InProgress) {
                sleep($interval);
            }
        }

        return $operation;
    }
652788
public function add($op)
  {
    $dst = clone $this;
    $dst->value = $this->_fix($this->_add($this->same($op, $this->prec)));
    return $dst;
  }
960807
protected function convertMap(Op\MapOp $op)
    {
        $mapOp   = new ProtoBuf\MapOp();
        $updates = [];
        $removes = [];

        foreach ($op->getMapUpdates() as $key => $value) {
            $map    = $this->convertMap($value);
            $update = $this->createMapUpdate($key, MapFieldType::MAP, $map);

            $updates[] = $update;
        }

        foreach ($op->getSetUpdates() as $key => $value) {
            $set    = $this->convertSet($value);
            $update = $this->createMapUpdate($key, MapFieldType::SET, $set);

            $updates[] = $update;
        }

        foreach ($op->getFlagUpdates() as $key => $value) {
            $flag   = $this->convertFlag($value);
            $update = $this->createMapUpdate($key, MapFieldType::FLAG, $flag);

            $updates[] = $update;
        }

        foreach ($op->getCounterUpdates() as $key => $value) {
            $counter = $this->convertCounter($value);
            $update  = $this->createMapUpdate($key, MapFieldType::COUNTER, $counter);

            $updates[] = $update;
        }

        foreach ($op->getRegisterUpdates() as $key => $value) {
            $register = $value->getValue();
            $update   = $this->createMapUpdate($key, MapFieldType::REGISTER, $register);

            $updates[] = $update;
        }

        foreach ($op->getMapRemoves() as $key => $value) {
            $removes[] = $this->createMapField($key, MapFieldType::MAP);
        }

        foreach ($op->getSetRemoves() as $key => $value) {
            $removes[] = $this->createMapField($key, MapFieldType::SET);
        }

        foreach ($op->getFlagRemoves() as $key => $value) {
            $removes[] = $this->createMapField($key, MapFieldType::FLAG);
        }

        foreach ($op->getCounterRemoves() as $key => $value) {
            $removes[] = $this->createMapField($key, MapFieldType::COUNTER);
        }

        foreach ($op->getRegisterRemoves() as $key => $value) {
            $removes[] = $this->createMapField($key, MapFieldType::REGISTER);
        }

        $mapOp->setUpdates($updates);
        $mapOp->setRemoves($removes);

        return $mapOp;
    }
876182
function getOperationData($operation){
		if ($this->endpointType == 'wsdl' && is_null($this->wsdl)) {
			$this->loadWSDL();
			if ($this->getError())
				return false;
		}
		if(isset($this->operations[$operation])){
			return $this->operations[$operation];
		}
		$this->debug("No data for operation: $operation");
	}
598288
private static Double getOperandAsNumeric(String op) {
        Double d = null;
        try {
            d = Double.valueOf(op);
        } catch (Exception e) {
            // Null is returned if not numeric.
        }
        return d;
    }
272255
public static function parseOperationName(Operation $operation)
    {
        $verb = self::deriveAction($operation->httpMethod, $operation->uri);

        $wordifiedPath = self::wordifyPath($operation->uri);

        if ($operation->version == 'stream') {
            $wordifiedPath = $wordifiedPath.'Stream';
        }

        if (preg_match("/^\/{urlname}.*/", $operation->uri) == 1) {
            $wordifiedPath = 'Group'.$wordifiedPath;
        }

        return ucfirst($verb.$wordifiedPath);
    }
213211
public static function toNumber($o)
    {
        if (is_int($o) === true || is_float($o) === true) {
            return $o;
        } else {
            if (is_bool($o) === true) {
                return ($o) ? 1 : 0;
            } elseif (is_numeric($o) === true && $o !== "") {
                return ($o + 0);
            }

            return null;
        }
    }
1039651
public static function toInt($o) : ?int
    {
        if (is_int($o) === true || is_float($o) === true) {
            return intval($o);
        } else {
            if (is_bool($o) === true) {
                return ($o) ? 1 : 0;
            } elseif (is_numeric($o) === true && $o !== "") {
                return intval($o + 0);
            }

            return null;
        }
    }
426085
public function whereIn($field, $param, string $op = ''): self
    {
        $ops = ['?'];
        if (is_array($param)) {
            $ops = array_fill(0, count($param), '?');
        }

        return $this->where($this->prepareField($field) .' IN ('. join(', ', $ops) .')', $param, $op);
    }
645756
public function sub($op)
  {
    $dst = clone $this;
    $dst->value = $this->_fix($this->_sub($this->same($op, $this->prec)));
    return $dst;
  }