/*!
\protected
Adds a result for mark \a $markName with optional message \a $message.
17045
function addToCurrentResult( $entry, $message = false )
    {
        $markName = $entry['name'];
        if ( !is_array( $this->CurrentResult ) )
        {
             $this->CurrentResult = array( 'name' => $markName,
                                           'start' => false,
                                           'end' => false,
                                           'result' => false,
                                           'normalized' => false,
                                           'prime' => false,
                                           'messages' => array() );
        }
        $repeatCount = $this->DefaultRepeatCount;
        if ( isset( $entry['repeat_count'] ) )
            $repeatCount = $entry['repeat_count'];
        $this->CurrentResult['repeat_count'] = $repeatCount;

        if ( isset( $entry['start'] ) )
            $this->CurrentResult['start'] = $entry['start'];
        if ( isset( $entry['end'] ) )
            $this->CurrentResult['end'] = $entry['end'];
        if ( isset( $entry['result'] ) )
            $this->CurrentResult['result'] = $entry['result'];
        if ( isset( $entry['normalized'] ) )
            $this->CurrentResult['normalized'] = $entry['normalized'];
        if ( isset( $entry['prime'] ) )
            $this->CurrentResult['prime'] = $entry['prime'];

        if ( $message )
            $this->CurrentResult['messages'][] = array( 'text' => $message );
    }
1160049
function add_message($mailbox, $message, $force = false)
    {
        if (!is_object($message) || empty($message->uid)) {
            return;
        }

        if (!($this->mode & self::MODE_MESSAGE)) {
            return;
        }

        $flags = 0;
        $msg   = clone $message;

        if (!empty($message->flags)) {
            foreach ($this->flags as $idx => $flag) {
                if (!empty($message->flags[$flag])) {
                    $flags += $idx;
                }
            }
        }

        unset($msg->flags);
        $msg = $this->db->encode($msg, true);

        // update cache record (even if it exists, the update
        // here will work as select, assume row exist if affected_rows=0)
        if (!$force) {
            $res = $this->db->query(
                "UPDATE {$this->messages_table}"
                ." SET `flags` = ?, `data` = ?, `expires` = " . ($this->ttl ? $this->db->now($this->ttl) : 'NULL')
                ." WHERE `user_id` = ?"
                    ." AND `mailbox` = ?"
                    ." AND `uid` = ?",
                $flags, $msg, $this->userid, $mailbox, (int) $message->uid);

            if ($this->db->affected_rows($res)) {
                return;
            }
        }

        $this->db->set_option('ignore_key_errors', true);

        // insert new record
        $res = $this->db->query(
            "INSERT INTO {$this->messages_table}"
            ." (`user_id`, `mailbox`, `uid`, `flags`, `expires`, `data`)"
            ." VALUES (?, ?, ?, ?, ". ($this->ttl ? $this->db->now($this->ttl) : 'NULL') . ", ?)",
            $this->userid, $mailbox, (int) $message->uid, $flags, $msg);

        // race-condition, insert failed so try update (#1489146)
        // thanks to ignore_key_errors "duplicate row" errors will be ignored
        if ($force && !$res && !$this->db->is_error($res)) {
            $this->db->query(
                "UPDATE {$this->messages_table}"
                ." SET `expires` = " . ($this->ttl ? $this->db->now($this->ttl) : 'NULL')
                    .", `flags` = ?, `data` = ?"
                ." WHERE `user_id` = ?"
                    ." AND `mailbox` = ?"
                    ." AND `uid` = ?",
                $flags, $msg, $this->userid, $mailbox, (int) $message->uid);
        }

        $this->db->set_option('ignore_key_errors', false);
    }
462091
public function mark($mark, $value=null)
     {
        $marks = $this->matchingListener->markToArray($mark, $value, $this->knownMarks);
        $newMarks = array_merge($this->marks, $marks);
        return new static($this->root, $newMarks, $this->markFilters);
     }
800978
protected function addError($name, $customMessage = null)
    {
        $this->errors[$name] = $customMessage ?: $this->message ?: $this->{$name . 'Message'};
    }
217976
public function markAsDisappeared($message = null)
    {
        if (!is_null($message)) {
            $this->setMessages($message);
        }
        $this
            ->setStatus(self::STATUS_DISAPPEARED)
            ->setFinishedAt($this->getLastSeen())
            ->save();

        $this->log(sprintf('Job "%s" (id: %s) disappeared. Message: %s', $this->getJobCode(), $this->getId(), $message));
    }
1350363
public function mark($name, $logFirst = false) {
        if (isset($this->_marks[$name])) {
            $this->_marks[$name]['time'] = round((microtime(true)-$_SERVER['REQUEST_TIME'])*1000-$this->_marks[$name]['time']).'ms';
            if (function_exists('memory_get_usage')) {
                $this->_marks[$name]['memory'] = round((memory_get_usage()-$this->_marks[$name]['memory'])/1024) . 'K';
            } else {
                $this->_marks[$name]['memory'] = 'N/A';
            }
            $this->_logger->zflog(
                array('time' => $this->_marks[$name]['time'],
                      'memory' => $this->_marks[$name]['memory'],
                      'message' => $name
                )
            );
        } else {
            $this->_marks[$name]['time'] = (microtime(true)-$_SERVER['REQUEST_TIME'])*1000;
            if (function_exists('memory_get_usage')) {
                $this->_marks[$name]['memory'] = memory_get_usage();
            } else {
                $this->_marks[$name]['memory'] = 'N/A';
            }
            if ($logFirst) {
                $this->_logger->zflog(
                    array('time' => round($this->_marks[$name]['time']).'ms',
                          'memory' => round($this->_marks[$name]['memory']/1024).'K',
                          'message' => $name
                    )
                );
            }
        }
    }
905708
public function pushMessage($queueName, $message)
    {
        $amqpMessage = new AMQPMessage($message, $this->defaultMessageParams);
        $this->getChannel()->basic_publish($amqpMessage, $this->exchange, $queueName);
    }
856725
private static void addDummyAssignment(Node node, String resultName) {
    checkArgument(node.isBlock());

    // A result is needed create a dummy value.
    Node srcLocation = node;
    Node retVal = NodeUtil.newUndefinedNode(srcLocation);
    Node resultNode = createAssignStatementNode(resultName, retVal);
    resultNode.useSourceInfoIfMissingFromForTree(node);

    node.addChildToBack(resultNode);
  }
1297883
protected function markChanged($name)
    {
        $diffVar = &$this->changedData;
        foreach (explode('.', $name) as $namePart) {
            if (!isset($diffVar[$namePart])) {
                $diffVar[$namePart] = [];
            }
            $diffVar = &$diffVar[$namePart];

            // Already diffed
            if ($diffVar === true) {
                return;
            }
        }
        // Mark changed
        $diffVar = true;
    }
417200
private function addMessage($name, $parts)
    {
        $this->addToDebug("Adding message: '$name'");
        $msg = $this->addElement('message', $this->definitions);
        $msg->setAttribute('name', $name);
        foreach ((array) $parts as $partName => $partType) {
            $this->addToDebug("Adding Message part: '$partName => $partType'");
            $part = $this->addElement('part', $msg);
            $this->xmlSchema->addType($partType, $partName, $part);
        }
    }
781929
public function addFlag(string $name): void
    {
        if (!$this->hasFlag($name)) {
            $flagEntry = $this->entry[PoTokens::FLAG];
            if ($flagEntry === null) {
                $this->set(PoTokens::FLAG, $name);
            } elseif (is_array($flagEntry)) {
                $flagEntry[] = $name;
                $this->set(PoTokens::FLAG, implode(',', $flagEntry));
            } else {
                $this->set(PoTokens::FLAG, $flagEntry . ',' . $name);
            }
        }
    }
1158577
public function updateMark(Mark $mark, $value)
    {
        $oldMark = $mark->getValue();
        $mark->setValue($value);
        $this->om->flush();
        // First of all update older mark events so as result would be new value
        $this->updateNewMarkEventResult($mark->getUser(), $mark->getId(), $value);
        // Then create new mark event to log update
        $newMarkEvent = new LogResultsNewMarkEvent($mark, $oldMark);
        $this->dispatcher->dispatch('log', $newMarkEvent);
    }
504037
protected function mark($name, $value, $message = null)
	{
		$this->report[] = array(
			'service' => $name,
			'is_spam' => $value,
			'message' => $message
		);
	}
79246
public function addMessageToQueue(Message $message, $name)
    {
        $q      = $this->getQueue($name);
        $qid    = $this->getQueueId($q->getName());
        $body   = base64_encode(serialize($message));
        $md5    = md5($body);

        $sql = 'INSERT INTO ' . $this->messageTable . '
            (queue_id, body, created, timeout, md5)
            VALUES
            (:queue_id, :body, :created, :timeout, :md5)
            ';
        $stmt = $this->getDb()->prepare($sql);
        $stmt->bindParam(':queue_id', $qid, \PDO::PARAM_INT);
        $stmt->bindParam(':body', $body, \PDO::PARAM_STR);
        $stmt->bindParam(':md5', $md5, \PDO::PARAM_STR);
        $stmt->bindValue(':created', time(), \PDO::PARAM_INT);
        $stmt->bindValue(':timeout', 30, \PDO::PARAM_INT);
        $stmt->execute();
        return true;
    }
1362687
def success(self, request, message, extra_tags='', fail_silently=False):
        """"""
        add(self.target_name, request, constants.SUCCESS, message, extra_tags=extra_tags,
            fail_silently=fail_silently)
521592
public function addAll(array $messages, $groupName = null) {
		foreach ($messages as $message) {
			$this->add($message, $groupName);
		}
	}
594183
public static function addMessageIfEmpty($message,$condition,$label='INFO'){
		if ( empty($condition)===true ) {
			self::debugbar()->addMessage($message,$label);
		}
	}