Returns receiver object

@param string $receiver

@return null|AbstractReceiver
17197
public function getReceiver(string $receiver)
    {
        $class = (string)$this->sprintf(':namespace\Receiver\:receiver', __NAMESPACE__, $receiver);

        if (class_exists($class)) {
            return new $class($this);
        }

        return null;
    }
717237
public static function getClient($protocol = null)
    {
        $protocol = $protocol ?: self::DEFAULT_PROTOCOL;
        return self::$clients[$protocol];
    }
581895
public function setReceiver(Receiver $receiver) {
        $this->pk = $receiver->getPrimaryKey();
        $this->class = get_class($receiver);
    }
785250
public static function get(string $target)
    {
        if (!self::has($target)) {
            return null;
        }

        if (!isset(self::$unserialized[$target])) {
            self::$unserialized[$target] = unserialize(self::$annotations[$target]);
        }

        return self::$unserialized[$target];
    }
151221
public function receive($timeout = null)
    {
        if (null == $this->message) {
            try {
                if ($message = $this->doReceive($this->receiveCallback, $this, $timeout)) {
                    $this->message = $message;
                }
            } finally {
                call_user_func($this->finallyCallback, $this);
            }
        }

        return $this->message;
    }
273706
public function receive(&$header)
    {
        $body = $this->relay->receiveSync($flags);

        if ($flags & Relay::PAYLOAD_CONTROL) {
            if ($this->handleControl($body, $header, $flags)) {
                // wait for the next command
                return $this->receive($header);
            }

            // no context for the termination.
            $header = null;

            // Expect process termination
            return null;
        }

        if ($flags & Relay::PAYLOAD_ERROR) {
            return new \Error($body);
        }

        return $body;
    }
275590
public function onEvent($sender, $params = null)
    {
        $h =$this->handler;
 
        if ($h != null) {
            return $this->receiver->{$h}($sender, $params);
        } else {
            return $this->handler($sender, $params);
        }
    }
209966
public function deleteSubscriber(string $channel): ?Subscriber
    {
        $key = self::SUBSCRIBER_KEY.".{$channel}";
        $hasSubscriber = $this->cache->has($key);

        $subscriber = $this->cache->get($key);

        if ($hasSubscriber) {
            $this->cache->forget($key);
        }

        return $subscriber;
    }
220170
public function subscriberByChannel(string $channel): ?Subscriber
    {
        $key = self::SUBSCRIBER_KEY.".{$channel}";

        return $this->cache->get($key);
    }
568964
public static function getHeader($header) {

		$headers = static :: getHeaders();

		if(true === isset($headers[$header])) {
			return $headers[$header];
		}

		return null;
	}
405801
public function getLibSrc($ver = null)
    {
        if ($ver == null) {
            $ver = $this->getVersion();
        }

        if (!$ver) {
            $ver = $this->defVersion;
        }

        $return = false;

        /** @var $service InterfaceDelivery */
        foreach ($this->getLibDelivers() as $name => $service) {
            $return = $service->getLibSrc($ver);
            if ($return) {
                break;
            }
        }

        if (!$return) {
            throw new \Exception('Can`t resolve to library.');
        }

        return $return;
    }
625244
private function getListener($listener)
	{
		$listenerClassName = Ioc::resolveClassName($listener);
		if (!isset($this->_listenerInstances[$listenerClassName])) {
			if (!($listener instanceof EventListenerInterface)) {
				$listener = Ioc::createObject($listener);
			}
			$this->_listenerInstances[$listenerClassName] = $listener;
		}
		
		return $this->_listenerInstances[$listenerClassName];
	}
795184
public function receive(ProtoStream $stream = null)
    {
        $socket = $stream ?: $this->getStream();
        $length = $this->receiveLengthHeader($socket);
        $code   = $this->receiveMessageCode($socket);
        $body   = ($length > 1)
            ? $this->receiveMessageBody($socket, $length - 1)
            : null;

        return [$code, $body];
    }
98806
def get_receiver(self, receiver=None):
        
        return self.__app.signals.get_receiver(receiver, self._plugin)
1138415
public function offsetGet($offset)
    {
        foreach ($this->observer as $observer) {
            if (strtolower($observer->getName()) === strtolower($offset)) {
                return $observer;
            }
        }

        return;
    }
1265187
public static function to()
    {
        $args = func_get_args();

        $receivers = [];

        foreach ($args as $arg) {
            if (is_string($arg)) {
                $receivers[] = $arg;
            } elseif (is_array($arg)) {
                foreach ($arg as $value) {
                    $receivers[] = $value;
                }
            }
        }

        $mail = new self();
        $mail->setDestination($receivers);

        return $mail;
    }
758294
public function findReceivedByObjectOrSender(
        User $receiver,
        $objectOrSenderUsernameSearch,
        $executeQuery = true
    )
    {
        $dql = "
            SELECT um, m, u
            FROM Claroline\MessageBundle\Entity\UserMessage um
            JOIN um.user u
            JOIN um.message m
            WHERE u.id = {$receiver->getId()}
            AND um.isRemoved = false
            AND um.isSent = false
            AND (
                UPPER(m.object) LIKE :search
                OR UPPER(m.senderUsername) LIKE :search
            )
            ORDER BY m.date DESC
        ";
        $query = $this->_em->createQuery($dql);
        $searchParameter = '%' . strtoupper($objectOrSenderUsernameSearch) . '%';
        $query->setParameter('search', $searchParameter);

        return $executeQuery ? $query->getResult() : $query;
    }