@param Subject $subject

@return Assignment|null
4259
public function getAssignmentForSubject(Subject $subject)
    {
        return $this->assignmentStorage->getAssignment($subject->getSubjectId(), $subject->getSubjectName());
    }
820708
public function update(SplSubject $subject)
    {
        if ($this->hasMethod('__update') && is_callable([$this, '__update'])) {
            $this->__update($subject);
        }
    }
469254
private function subject()
    {
        $subject = is_null($this->mailable->get('_subject')) ? config('mail.subject') : $this->mailable->get('_subject');

        $this->message->setSubject($subject);
    }
470370
public function setSubject($subject = '')
    {
        $this->subject = $subject;
        $this->debug->debug(__FUNCTION__, 'setSubject: ', $this->subject);
    }
809217
private function getMessage($subject)
    {
        if (method_exists($subject, 'getMessage')) {
            $message = $subject->getMessage();
        } else {
            $message = $this->useReflectionToGetMessage($subject);
        }

        return $message;
    }
589905
public function findBySubject(ContentSubjectInterface $subject)
    {
        $content = $subject->getContent();

        if (null !== $content && property_exists($content, '__isInitialized__') && !$content->{'__isInitialized__'}) {
            $qb = $this->getQueryBuilder();
            $qb
                ->leftJoin('c.containers', 'container')
                ->leftJoin('container.rows', 'row')
                ->leftJoin('row.blocks', 'block')
                ->leftJoin('block.translations', 'block_t')
                ->select('PARTIAL c.{id}', 'container', 'row', 'block', 'block_t')
                ->andWhere($qb->expr()->eq('c.id', ':id'))
                ->getQuery()
                ->useQueryCache(true)
                // TODO ->useResultCache(true, 3600, Content::getEntityTagPrefix() . '[id:'.$id.']')
                ->setParameter('id', $content->getId())
                ->getOneOrNullResult();
        }

        return $content;
    }
415872
protected function _getFindResult($subject)
    {
        if (!empty($subject->entities)) {
            if (isset($subject->query)) {
                $subject->entities = $this->_deduplicateResultSet($subject);
            }

            return $subject->entities;
        }

        return $subject->entity;
    }
572765
public function finderFor($subject)
    {
        $class = $this->initialize($subject);

        if(!isset($this->_finders[$class]))
            throw new Exception("No finder registered for $class");

        return $this->_finders[$class];
    }
728728
public function getClientKey($client_id, $subject)
    {
        if (isset($this->jwt[$client_id])) {
            $jwt = $this->jwt[$client_id];
            if ($jwt) {
                if ($jwt["subject"] == $subject) {
                    return $jwt["key"];
                }
            }
        }

        return null;
    }
53940
protected function _findRecord($id, Subject $subject)
    {
        $repository = $this->_table();
        $this->_configIndex($repository, $this->_request());

        if ($this->_request()->query('type')) {
            $repository->name($this->_request()->query('type'));
        }

        $query = $repository->find($this->findMethod());
        $query->where(['_id' => $id]);
        $subject->set([
            'repository' => $repository,
            'query' => $query
        ]);
        $this->_trigger('beforeFind', $subject);
        $entity = $query->first();
        if (!$entity) {
            return $this->_notFound($id, $subject);
        }
        $subject->set(['entity' => $entity, 'success' => true]);
        $this->_trigger('afterFind', $subject);

        return $entity;
    }
1335302
protected function getPermissionsForSubject(Subject $subject)
    {
        $permissions = [];

        foreach ($this->getRolesForSubject($subject) as $role) {
            if ($role->hasPermissions()) {
                $permissions = array_merge($this->getPermissionsByNames($role->getPermissions()), $permissions);
            }
        }

        return $permissions;
    }
94151
protected static function _getValue($from, $subject) {
		$cached = static::_getCache($from, $subject);
		if (isset($cached)) {
			return $cached;
		}

		$value = null;
		switch (true) {
			case is_array($subject):
				$value = Set::get($subject, $from);
				break;
			case is_object($subject) && is_string($from):
				if (isset($subject->$from)) {
					$value = $subject->$from;
				} elseif (method_exists($subject, $from)) {
					$value = $subject->{$from}();
				} else {
					throw new InvalidArgumentException('Method or attribute does not exists: ' . $from);
				}
				break;
			case is_numeric($subject) || is_string($subject):
				$value = $subject;
				break;
			case is_callable($from):
				$value = call_user_func($from, $subject);
				break;
			default:
				throw new InvalidArgumentException('Wrong type combination: subject -> ' . gettype($subject) . ', from -> ' . gettype($from));
		}

		if (is_array($value)) {
			$value = count($value);
		}
		static::_setCache($from, $subject, $value);
		return $value;
	}
599362
public function decorate($subject)
    {
        $items = $this->getItems($subject);

        foreach ($items->keys() as $key) {
            $items->put($key, $this->autoPresenter->decorate($items->get($key)));
        }

        return $subject;
    }
860803
public function subject($subject = null)
    {
        $headers = $this->headers();
        if (!func_num_args()) {
            return $headers['Subject'];
        }
        $headers['Subject'] = Mime::encodeValue($subject, 998, "\r\n ");
        return $this;
    }
678188
public function empty($subject) : bool
    {
        if (!$subject) {
            // Stringed zero - '0' - is not empty.
            return $subject !== '0';
        }
        if (is_object($subject)) {
            if ($subject instanceof \Countable) {
                return !count($subject);
            }
            if ($subject instanceof \Traversable) {
                // No need to check/use ArrayObject|ArrayIterator, because
                // those are both Countable (checked before this check).

                // Have to iterate; horrible.
                foreach ($subject as $ignore) {
                    return false;
                }
                return true;
            }
            if ($subject instanceof \ArrayAccess) {
                return false;
            }
            return !get_object_vars($subject);
        }
        return false;
    }
893974
protected function getItems(Paginator $subject)
    {
        $object = new ReflectionObject($subject);

        $items = $object->getProperty('items');
        $items->setAccessible(true);

        return $items->getValue($subject);
    }
984190
public function withSubject(Name $subject): self
    {
        $obj = clone $this;
        $obj->_subject = $subject;
        return $obj;
    }