This controls where the notification will be placed.
@param string $from top, bottom
@param string $align left, right, center
@return LaranotifyService
484092
public function placement($from, $align)
    {
        $this->placement['from'] = $from;
        $this->placement['align'] = $align;

        return $this->setNotifier();
    }
1013643
public function endpoint_sendmessage($to = NULL, $from = NULL, $body = NULL)
        {
            return $this->sendmessage($to, $from, $body);
        }
1014812
public function onMessage(ConnectionInterface $from, $msg) {
    $data = json_decode($msg, true);
    if (!$data['action']
        || !in_array(
            $data['action'],
            ['authenticate', 'subscribe', 'unsubscribe', 'publish']
        )) {
      return;
    }
    switch ($data['action']) {
      case 'authenticate':
        $this->handleAuthentication($from, $data);
        break;
      case 'subscribe':
      case 'unsubscribe':
        $this->handleSubscription($from, $data);
        break;
      case 'publish':
        $this->handlePublish($from, $msg, $data);
        break;
    }
  }
347625
protected function createExchangeForMessageFromURI(MessageInterface $message, $from)
    {
        $version = $message->getContext()->get(Context::FLOWS_VERSION);
        $params = $this->itineraryResolver->getItineraryParams($from, $version);
        $itinerary = $params[InternalRouter::KEY_ITINERARY];

        $exchange = new Exchange($message, clone $itinerary);
        $exchange->setHeader(Exchange::HEADER_HANDLER, $this->getId());
        $exchange->setHeader(Exchange::HEADER_FROM, $from);

        foreach ($this->itineraryResolver->filterItineraryParamsToPropagate($params) as $key => $value) {
            $exchange->setHeader($key, $value);
        }

        return $exchange;
    }
1176359
protected function buildReply($to, $from, $message)
    {
        $base = [
            'ToUserName'   => $to,
            'FromUserName' => $from,
            'CreateTime'   => time(),
            'MsgType'      => is_array($message) ? current($message)->getType() : $message->getType(),
        ];

        $transformer = new Transformer();

        return XML::build(array_merge($base, $transformer->transform($message)));
    }
951260
public function setFrom($from)
    {
        $attr = $this->createAttribute('from');
        $this->doc->appendChild($attr);
        $attr->appendChild($this->createTextNode($from));
    }
996508
public function from($from = null) {
        if ($from === null) {
            return $this->from;
        }

        $this->from = (int) $from;

        return $this;
    }
550938
protected function notifyDanger($content) {
        $notification = NotificationFactory::newDangerNotification($content);
        return $this->notify(NotificationEvents::NOTIFICATION_DANGER, $notification);
    }
471243
private function handlePublishUid(ConnectionInterface $from, $data) {
    $this->logger->notice(
        "Received a UID publish! (".
          (
            isset($data['name'])
                ? $data['name']
                : "{$data['oldName']} => {$data['newName']}"
          ).
          ", {$data['event']}, {$from->resourceId})"
    );

    foreach ($data as $key => $name) {
      if (!in_array($key, ['name', 'newName', 'oldName'])
          || !key_exists($name, $this->uidSubs)) {
        continue;
      }
      foreach ($this->uidSubs[$name] as $curClient) {
        $this->logger->notice(
            "Notifying client of {$data['event']}! ".
              "($name, {$curClient->resourceId})"
        );
        $payload = [
          'uid' => $name,
          'event' => $data['event']
        ];
        if (isset($data['value'])) {
          $payload['value'] = $data['value'];
        }
        $curClient->send(json_encode($payload));
      }
    }
  }
756741
private function handleSubscriptionQuery(ConnectionInterface $from, $data) {
    $args = json_decode($data['query'], true);
    if (!class_exists($args[0]['class'])) {
      return;
    }
    $count = count($args);
    if ($count > 1) {
      for ($i = 1; $i < $count; $i++) {
        $newArg =
          \Nymph\REST::translateSelector($args[0]['class'], $args[$i]);
        if ($newArg === false) {
          return;
        }
        $args[$i] = $newArg;
      }
    }
    $etype = $args[0]['class']::ETYPE;
    $serialArgs = serialize($args);
    $this->prepareSelectors($args);

    if ($data['action'] === 'subscribe') {
      // Client is subscribing to a query.
      if (!key_exists($etype, $this->querySubs)) {
        $this->querySubs[$etype] = [];
      }
      if (!key_exists($serialArgs, $this->querySubs[$etype])) {
        $this->querySubs[$etype][$serialArgs] = new \SplObjectStorage();
      }
      $guidArgs = $args;
      $guidArgs[0]['return'] = 'guid';
      $guidArgs[0]['source'] = 'client';
      $token = null;
      if ($this->sessions->contains($from)) {
        $token = $this->sessions[$from];
      }
      if (class_exists('\Tilmeld\Tilmeld') && isset($token)) {
        $user = \Tilmeld\Tilmeld::extractToken($token);
        if ($user) {
          // Log in the user for access controls.
          \Tilmeld\Tilmeld::fillSession($user);
        }
      }
      $this->querySubs[$etype][$serialArgs][$from] = [
        'current' => call_user_func_array(
            "\Nymph\Nymph::getEntities",
            $guidArgs
        ),
        'query' => $data['query'],
        'count' => !!$data['count']
      ];
      if (class_exists('\Tilmeld\Tilmeld') && isset($token)) {
        // Clear the user that was temporarily logged in.
        \Tilmeld\Tilmeld::clearSession();
      }
      $this->logger->notice(
          "Client subscribed to a query! ".
            "($serialArgs, {$from->resourceId})"
      );

      if (Server::$config['broadcast_counts']) {
        // Notify clients of the subscription count.
        $count = count($this->querySubs[$etype][$serialArgs]);
        foreach ($this->querySubs[$etype][$serialArgs] as $key) {
          $curData = $this->querySubs[$etype][$serialArgs][$key];
          if ($curData['count']) {
            $key->send(json_encode([
              'query' => $curData['query'],
              'count' => $count
            ]));
          }
        }
      }
    }

    if ($data['action'] === 'unsubscribe') {
      // Client is unsubscribing from a query.
      if (!key_exists($etype, $this->querySubs)) {
        return;
      }
      if (!key_exists($serialArgs, $this->querySubs[$etype])) {
        return;
      }
      if (!$this->querySubs[$etype][$serialArgs]->contains($from)) {
        return;
      }
      unset($this->querySubs[$etype][$serialArgs][$from]);
      $this->logger->notice(
          "Client unsubscribed from a query! ".
            "($serialArgs, {$from->resourceId})"
      );

      $count = count($this->querySubs[$etype][$serialArgs]);

      if ($count === 0) {
        // No more subscribed clients.
        unset($this->querySubs[$etype][$serialArgs]);
        if (count($this->querySubs[$etype]) === 0) {
          unset($this->querySubs[$etype]);
        }
        return;
      }

      if (Server::$config['broadcast_counts']) {
        // Notify clients of the subscription count.
        foreach ($this->querySubs[$etype][$serialArgs] as $key) {
          $curData = $this->querySubs[$etype][$serialArgs][$key];
          if ($curData['count']) {
            $key->send(json_encode([
              'query' => $curData['query'],
              'count' => $count
            ]));
          }
        }
      }
    }
  }
721935
public static function move($from, $to)
    {
        return self::copy($from, $to) && self::delete($from);
    }
587319
public function createTopicNotification($title = null, $body = null, $topic = null)
    {
        $notification = new TopicNotification();
        $notification
            ->setTitle($title)
            ->setBody($body)
            ->setTopic($topic);

        return $notification;
    }
1067117
protected function getDefaultMessage($from, $encoding, $to, $subject, $body) {
        if(is_string($from)) {
            $from = array('email' => $from, 'name' => $from);
        }

        $message = new MailMessage();
        $message->setFrom($from['email'], $from['name'])
            ->setEncoding($encoding)
            ->setSubject($subject)
            ->setBody($body)
            ->setTo($to);

        return $message;
    }
571854
public function setFrom(\WobbleCode\UserBundle\Document\User $from)
    {
        $this->from = $from;
        return $this;
    }
489461
public function setAlign($align)
    {
        if (!is_string($align) || !in_array(strtolower($align), ['left', 'right', 'center'], true)) {
            throw new Exception\InvalidArgumentException(__METHOD__ . ' Align param must be a string : right, left, center.');
        }
        $this->properties['align'] = $align;

        return $this;
    }
691625
public static function align(string $align) : string {
		if (empty($align)) $align = 'left';
		if (I18n::rtl()) {
			if ($align == 'left') {
				$align = 'right';
			} else if ($align == 'right') {
				$align = 'left';
			}
		}
		return $align;
	}
140488
public function byRevision(string $from, string $to = ''): Log
    {
        $this->since = ' ' . escapeshellarg($from) . '..'
                     . (empty($to) ? '' : escapeshellarg($to));
        return $this;
    }