Open a subject.

@param \Claroline\ForumBundle\Entity\Subject $subject
195381
public function openSubject(Subject $subject)
    {
        $this->om->startFlushSuite();
        $subject->setIsClosed(false);
        $this->om->persist($subject);
        $this->dispatch(new OpenSubjectEvent($subject));
        $this->om->endFlushSuite();
    }
419717
protected function supportSubject($subject)
    {
        if (is_object($subject)) {
            return $this->supportClasses(
                $subject,
                array(
                    'OpenOrchestra\ModelInterface\Model\ContentTypeInterface',
                    'OpenOrchestra\ModelInterface\Model\WorkflowProfileInterface',
                    'OpenOrchestra\ModelInterface\Model\StatusInterface'
                )
            );
        }

        return in_array(
            $subject,
            array(
                ContentTypeInterface::ENTITY_TYPE,
                WorkflowProfileInterface::ENTITY_TYPE,
                StatusInterface::ENTITY_TYPE
            )
        );
    }
262419
public function update(SplSubject $subject)
    {
        if ($subject instanceof Model) {
            $this->data = \array_merge($this->data, $subject->get());
        }
    }
137306
public static function create(Model $subject, $file)
    {
        return app(FileAdder::class)
            ->setSubject($subject)
            ->setFile($file);
    }
150308
public function update(SubjectInterface $subject)
   {
       if ($subject instanceof ModelInterface) {
           foreach (json_decode(json_encode($subject)) as $key => $value) {
               $this->appendValueTo($this->template, $key, $value);
           }
           return $subject;
       }
   }
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];
    }
488297
public function render(Subject $subject)
    {
        $this->injectViewClasses();
        $this->_ensureSuccess($subject);
        $this->_ensureData($subject);
        $this->_ensureSerialize();

        return $this->_controller()->render();
    }
1271636
public function setSubject($subject)
    {
        $allowedValues = $this->getSubjectAllowableValues();
        if (!is_null($subject) && !in_array($subject, $allowedValues)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'subject', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['subject'] = $subject;

        return $this;
    }
987931
private function createAndPersistConversation($subject)
    {
        $conversation = $this->driver->createConversationModel();
        $conversation->setSubject($subject);

        $this->driver->persistConversation($conversation);

        return $conversation;
    }
1208972
public function construct($subject, &$data = array())
    {
        if (null === $this->constructed) {
            $this->constructed = unserialize(
                sprintf(
                    'O:%d:"%s":0:{}',
                    strlen($subject),
                    $subject
                )
            );
        }
        return clone $this->constructed;
    }
129895
public function process(MetadataInterface $metadata, $subject): void
    {
        $metadata->field = true;
        $metadata->fieldName = $subject->name ?? $metadata->name;
        $metadata->type = $subject->type;
        $metadata->multiple = $subject->multiple;
        $metadata->options = $subject->options;
        $metadata->lazy = $subject->lazy;
    }
329372
public function updateSubject(int $conversationId, string $subject): void
    {
        $patch = Patch::replace('subject', $subject);
        $this->patchConversation($conversationId, $patch);
    }
15919
public function update(SubjectInterface $subject)
   {
       try {
           foreach ($this->observer as $value) {
               $value->update($subject);
           }
       } catch (Throwable $e) {
           throw new ViewException(
               "Can't update " . static::class . " " . $e->getMessage()
           );
       }
   }
1174828
public static function allow(Subject $subject, array $verbs = null): Rule
    {
        return new self($subject, true, $verbs);
    }
124393
public function variable($subject, $options = []) : Inspector
    {
        // Init.----------------------------------------------------------------
        $this->loadDependencies();

        // Business.------------------------------------------------------------

        $options['kind'] = 'variable';
        $class_inspector = static::CLASS_INSPECTOR;
        /** @var Inspector */
        return new $class_inspector(
            $this,
            $subject,
            $options
        );
    }
1259065
public function setGlobalSubject($subject)
    {
        if (!($subject instanceof Subject)) {
            $subject = new Subject($subject);
        }
        $this->subject = $subject;
    }
1175869
public function subject($subject)
    {
        $name = Config::get('name');
        $subject = '[' . $name . '] ' . $subject;
        /**
         * strange subject encode error
         * occurred when there's both chinese and english
         * solution see: https://github.com/swiftmailer/swiftmailer/issues/665
         */
        $subject = '=?utf-8?B?'.base64_encode($subject).'?=';
        $this->message->setSubject($subject);
        return $this;
    }