Selects an specific Crud view class to render the output

@param \Crud\Event\Subject $subject Subject
@return \Cake\Http\Response
488297
public function render(Subject $subject)
    {
        $this->injectViewClasses();
        $this->_ensureSuccess($subject);
        $this->_ensureData($subject);
        $this->_ensureSerialize();

        return $this->_controller()->render();
    }
603106
protected function _renderWithResources($subject)
    {
        $repository = $this->_controller()->loadModel(); // Default model class

        if (isset($subject->query)) {
            $usedAssociations = $this->_getContainedAssociations($repository, $subject->query->getContain());
        } else {
            $entity = $this->_getSingleEntity($subject);
            $usedAssociations = $this->_extractEntityAssociations($repository, $entity);
        }

        // only generate the `included` node if the option is set by query parameter or config
        // (which will not be the case when viewing a single Resource without parameters).
        if ($this->getConfig('include') || $this->_ControllerHasSetContain === true) {
            $include = $this->_getIncludeList($usedAssociations);
        } else {
            $include = [];
        }

        // Set data before rendering the view
        $this->_controller()->set([
            '_withJsonApiVersion' => $this->getConfig('withJsonApiVersion'),
            '_meta' => $this->getConfig('meta'),
            '_absoluteLinks' => $this->getConfig('absoluteLinks'),
            '_jsonApiBelongsToLinks' => $this->getConfig('jsonApiBelongsToLinks'),
            '_jsonOptions' => $this->getConfig('jsonOptions'),
            '_debugPrettyPrint' => $this->getConfig('debugPrettyPrint'),
            '_repositories' => $this->_getRepositoryList($repository, $usedAssociations),
            '_include' => $include,
            '_fieldSets' => $this->getConfig('fieldSets'),
            Inflector::tableize($repository->getAlias()) => $this->_getFindResult($subject),
            '_serialize' => true,
            '_inflect' => $this->getConfig('inflect')
        ]);

        return $this->_controller()->render();
    }
360574
public function deleteSubjectAction(Subject $subject)
    {
        if ($this->authorization->isGranted('moderate', new ResourceCollection(array($subject->getCategory()->getForum()->getResourceNode())))) {

            $this->manager->deleteSubject($subject);

            return new RedirectResponse(
                $this->generateUrl('claro_forum_subjects', array('category' => $subject->getCategory()->getId()))
            );
        }

        throw new AccessDeniedException();
    }
1337778
public function renderCompleted($subject, Cardinality $cardinality): string
    {
        $isCall = $subject instanceof Call;

        if ($isCall) {
            $calls = [$subject];
            $renderedCallee =
                $this->exporter->exportCallable($subject->callback());
        } else {
            $calls = $subject->allCalls();
            $renderedCallee = $this->exporter->exportCallable($subject);
        }

        $renderedSubject = $this->bold . $renderedCallee . $this->reset;

        $minimum = $cardinality->minimum();
        $maximum = $cardinality->maximum();
        $isNever = 0 === $maximum;

        if ($isCall) {
            if ($isNever) {
                $expected =
                    'Expected ' . $renderedSubject .
                    ' call #' . $subject->index() . ' not to complete.';
            } else {
                $expected =
                    'Expected ' . $renderedSubject .
                    ' call #' . $subject->index() . ' to complete.';
            }
        } else {
            if ($isNever) {
                $expected =
                    'Expected ' . $renderedSubject . ' not to complete.';
            } elseif ($cardinality->isAlways()) {
                $expected =
                    'Expected all ' . $renderedSubject . ' calls to complete.';
            } else {
                $expected =
                    'Expected ' . $renderedSubject . ' to complete.';
            }
        }

        $totalCount = count($calls);
        $matchCount = 0;

        if ($totalCount) {
            $renderedCalls = [];

            foreach ($calls as $call) {
                $endEvent = $call->endEvent();

                if ($endEvent) {
                    ++$matchCount;
                }

                if ($endEvent xor $isNever) {
                    $renderedResult = $this->pass;
                } else {
                    $renderedResult = $this->fail;
                }

                $renderedArguments = [];

                foreach ($call->arguments()->all() as $argument) {
                    $renderedArguments[] =
                        $this->exporter->export($argument, 0);
                }

                $responseEvent = $call->responseEvent();

                if ($responseEvent instanceof ReturnedEvent) {
                    $returnValue = $responseEvent->value();

                    if (
                        is_array($returnValue) ||
                        $returnValue instanceof Traversable
                    ) {
                        $iterableEvents = $call->iterableEvents();
                        $renderedIterableEvents = [];

                        foreach ($iterableEvents as $event) {
                            if ($event instanceof UsedEvent) {
                                $renderedIterableEvents[] =
                                    '        - Started iterating';
                            } elseif ($event instanceof ProducedEvent) {
                                $iterableKey = $event->key();
                                $iterableValue = $event->value();

                                $renderedIterableEvents[] =
                                    '        - Produced ' .
                                    $this->exporter->export($iterableKey) .
                                    ' => ' .
                                    $this->exporter->export($iterableValue);
                            } elseif ($event instanceof ReceivedEvent) {
                                $iterableValue = $event->value();

                                $renderedIterableEvents[] =
                                    '        - Received ' .
                                    $this->exporter->export($iterableValue);
                            } elseif (
                                $event instanceof ReceivedExceptionEvent
                            ) {
                                $iterableException = $event->exception();

                                $renderedIterableEvents[] =
                                    '        - Received exception ' .
                                    $this->exporter
                                        ->export($iterableException);
                            }
                        }

                        if (empty($iterableEvents)) {
                            $renderedIterableEvents[] =
                                '        ' . $renderedResult .
                                ' Never started iterating';
                        } elseif ($endEvent instanceof ConsumedEvent) {
                            $renderedIterableEvents[] =
                                '        ' . $renderedResult .
                                ' Finished iterating';
                        } elseif ($endEvent instanceof ReturnedEvent) {
                            $eventValue = $endEvent->value();

                            $renderedIterableEvents[] =
                                '        ' . $renderedResult . ' Returned ' .
                                $this->exporter->export($eventValue);
                        } elseif ($endEvent instanceof ThrewEvent) {
                            $eventException = $endEvent->exception();

                            $renderedIterableEvents[] =
                                '        ' . $renderedResult . ' Threw ' .
                                $this->exporter->export($eventException);
                        } else {
                            $renderedIterableEvents[] =
                                '        ' . $renderedResult .
                                ' Never finished iterating';
                        }

                        $renderedResponse =
                            'Returned ' .
                            $this->exporter->export($returnValue, 0) .
                            ', then:' . PHP_EOL .
                            implode(PHP_EOL, $renderedIterableEvents);
                    } else {
                        $renderedResponse =
                            'Returned ' . $this->exporter->export($returnValue);
                    }
                } elseif ($responseEvent instanceof ThrewEvent) {
                    $exception = $responseEvent->exception();
                    $renderedResponse =
                        'Threw ' . $this->exporter->export($exception);
                } else {
                    $renderedResponse = 'Never responded';
                }

                $renderedCalls[] =
                    $renderedResult .
                    ' Call #' . $call->index() .
                    ' - ' . $renderedCallee .
                    '(' . implode(', ', $renderedArguments) . '):' .
                    PHP_EOL . '    ' . $renderedResult .
                    ' ' . $renderedResponse;
            }

            $actual = PHP_EOL . implode(PHP_EOL, $renderedCalls);
        } else {
            $actual = '';
        }

        if ($isCall) {
            $cardinality = '';
        } else {
            $cardinality = $this->renderCardinality(
                $minimum,
                $maximum,
                $matchCount,
                $totalCount,
                $totalCount,
                false
            );
        }

        return $this->reset . $expected . $cardinality . $actual;
    }
792570
public function closeSubjectAction(Subject $subject)
    {
        $forum = $subject->getCategory()->getForum();
        $this->checkAccess($forum);
        $this->manager->closeSubject($subject);

        return new RedirectResponse(
            $this->generateUrl('claro_forum_subjects', array('category' => $subject->getCategory()->getId()))
        );
    }
1061438
public function subject($subject)
    {
        try {
            $this->mailer->Subject = $subject;
        } catch (phpmailerException $e) {
            throw new EmailException($e->getMessage(), $e->getCode());
        }

        return $this;
    }
1090703
public function executeSending( $subject, $body, $subscriber )
    {
        $email = $subscriber->attribute( 'email' );
        $parameters = array();
        $parameters['content_type'] = $this->emailContentType;
        $parameters['from'] = $this->emailFrom;
        $transport = eZNotificationTransport::instance( 'ezmail' );
        $result = $transport->send( array( $email ), $subject, $body, null, $parameters );
        if ( $result === false )
        {
            throw new Exception( 'Send email error! Subscriber id:' .$subscriber->attribute( 'id' ) );
        }
        eZDebugSetting::writeNotice( 'extension-ezcomments', "An email has been sent to '$email' (subject: $subject)", __METHOD__ );
    }
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;
       }
   }
476809
public function update(SplSubject $subject, $event = null)
    {
        switch ($event) {
            case 'log':
                /* @var Doozr_Logging $subject */
                $logs = $subject->getCollectionRaw();

                foreach ($logs as $log) {
                    $this->log(
                        $log['type'],
                        $log['message'],
                        unserialize($log['context']),
                        $log['time'],
                        $log['fingerprint'],
                        $log['separator']
                    );
                }
                break;
        }
    }
362259
protected function _error(Subject $subject)
    {
        $subject->set(['success' => false, 'created' => false]);

        $this->_trigger('afterSave', $subject);
        $this->setFlash('error', $subject);
        $this->_trigger('beforeRender', $subject);
    }
1346483
public function afterExecute(
        \Magento\UrlRewrite\Controller\Adminhtml\Url\Rewrite\Save $subject,
        $result
    ) {
        $productId = (int)$this->request->getParam('product', 0);
        if ($productId) {
            $this->catalogResource->setModified([$productId]);
        }
        return $result;
    }
781054
protected function _get()
    {
        $subject = $this->_subject([
            'success' => true,
            'entity' => $this->_entity($this->_request()->getQuery() ?: null, ['validate' => false] + $this->saveOptions())
        ]);

        $this->_trigger('beforeRender', $subject);
    }
722474
public function sendEmail($subject, $view, $vars = [])
    {
        $vars['email'] = $email = $this->email;
        $vars['username'] = $username = $this->username;

        Mail::queue(['text' => $view], $vars, function ($message) use ($email, $username, $subject) {
            $message->subject($subject)->to($email, $username);

            if (config()->has('mail.reply_to')) {
                $message->replyTo(
                    config('mail.reply_to.email'),
                    config('mail.reply_to.name')
                );
            }
        });
    }
1342287
public function stickSubjectAction(Subject $subject)
    {
        $forum = $subject->getCategory()->getForum();
        $this->checkAccess($forum);
        $this->manager->stickSubject($subject);

        return new RedirectResponse(
            $this->generateUrl('claro_forum_subjects', array('category' => $subject->getCategory()->getId()))
        );
    }
389955
public function fromSubject(JWTSubject $subject)
    {
        $payload = $this->makePayload($subject);

        return $this->manager->encode($payload)->get();
    }
1270353
def subject(self):
        
        template_name = self.subject_template_name() if \
            callable(self.subject_template_name) \
            else self.subject_template_name
        subject = loader.render_to_string(
            template_name, self.get_context(), request=self.request
        )
        return ''.join(subject.splitlines())
711852
protected function renderEmail(
        $subject,
        $receiverEmail,
        array $context = []
    ) {
        $message = Swift_Message::newInstance()
            ->setSubject($subject)
            ->setFrom($this->fromEmail)
            ->setTo($receiverEmail)
            ->setContentType('text/html')
            ->setBody(
                $this->templatingEngine->render(
                    $this->template,
                    array_merge(
                        $context,
                        ['layout' => $this->layout]
                    )
                )
            );

        $this
            ->mailer
            ->send($message);

        return $this;
    }