本文整理汇总了PHP中Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter::getClass方法的典型用法代码示例。如果您正苦于以下问题:PHP ParamConverter::getClass方法的具体用法?PHP ParamConverter::getClass怎么用?PHP ParamConverter::getClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter
的用法示例。
在下文中一共展示了ParamConverter::getClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: supports
/**
* {@inheritdoc}
*/
public function supports(ParamConverter $configuration)
{
if (null === $configuration->getClass()) {
return false;
}
return 'Bluemesa\\Bundle\\CoreBundle\\Entity\\DatePeriod' === $configuration->getClass();
}
示例2: supports
/**
* {@inheritdoc}
*/
public function supports(ParamConverter $configuration)
{
if (null === $configuration->getClass()) {
return false;
}
return isset(self::$supportedTypes[$configuration->getClass()]);
}
示例3: supports
public function supports(ParamConverter $configuration)
{
if (null === $configuration->getClass()) {
return false;
}
return in_array($configuration->getClass(), $this->supportedTypes);
}
示例4: supports
/**
* @param ParamConverter $configuration
* @return bool
*/
public function supports(ParamConverter $configuration)
{
if (null === $configuration->getClass()) {
return false;
}
return 'CiTron\\Project\\Entity\\Project' === $configuration->getClass();
}
示例5: supports
/**
* Checks if the object is supported.
*
* @param ParamConverter $configuration Should be an instance of ParamConverter
*
* @return bool True if the object is supported, else false
*/
public function supports(ParamConverter $configuration)
{
if (null === $configuration->getClass()) {
return false;
}
return $configuration->getClass() === Category::class;
}
示例6: supports
public function supports(ParamConverter $configuration)
{
if (null === $configuration->getClass()) {
return false;
}
$class = $configuration->getClass();
return $class == 'Staffim\\DTOBundle\\Collection\\Pagination';
}
示例7: supports
public function supports(ParamConverter $configuration)
{
if (null === $configuration->getClass()) {
return false;
}
$supportedTypes = [SearchRequest::class, SearchRequestInterface::class];
return in_array($configuration->getClass(), $supportedTypes);
}
示例8: apply
public function apply(Request $request, ParamConverter $configuration)
{
$result = null;
if ($configuration->getClass() == 'Symfony\\Component\\HttpFoundation\\File\\UploadedFile') {
$result = $this->parseFile($configuration->getName(), $request);
} else {
$result = $this->parser->parseClass($configuration->getClass(), $request->getContent());
}
$request->attributes->set($configuration->getName(), $result);
return true;
}
示例9: supports
/**
* Checks if the object is supported.
*
* @param ParamConverter $configuration Should be an instance of ParamConverter
*
* @return bool True if the object is supported, else false
*/
public function supports(ParamConverter $configuration)
{
if (null === $configuration->getClass()) {
return false;
}
if (array_key_exists($configuration->getClass(), $this->targetEntitiesArray)) {
return true;
} else {
return false;
}
}
示例10: supports
/**
* @inheritdoc
*/
public function supports(ParamConverter $configuration)
{
if ($configuration->getClass() === null) {
return false;
}
try {
$class = new \ReflectionClass($configuration->getClass());
} catch (\ReflectionException $e) {
return false;
}
return $this->reader->getClassAnnotation($class, RequestAnnotation::class) !== null;
}
示例11: supports
/**
* @inheritdoc
*/
public function supports(ParamConverter $configuration)
{
// Check, if option class was set in configuration
if (null === $configuration->getClass()) {
return false;
}
// Get the manager for the passed class (by default, the default entity manager)
$manager = $this->getDoctrine()->getManagerForClass($configuration->getClass());
// Check that the manager has the correct Class
if ('WCS\\CantineBundle\\Entity\\Eleve' !== $manager->getClassMetadata($configuration->getClass())->getName()) {
return false;
}
return true;
}
示例12: supports
/**
* @param \Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter $configuration
* @return bool
*/
public function supports(ParamConverter $configuration)
{
if (!$configuration instanceof ParamConverter) {
return false;
}
if (!class_exists($configuration->getClass()) && !interface_exists($configuration->getClass())) {
return false;
}
$implements = class_implements($configuration->getClass());
if (in_array('FSi\\Bundle\\AdminBundle\\Admin\\Element', $implements)) {
return true;
}
return false;
}
示例13: supports
/**
* {@inheritdoc}
*/
function supports(ParamConverter $configuration)
{
if (null === $this->registry || !count($this->registry->getManagers())) {
return false;
}
if (null === $configuration->getClass()) {
return false;
}
$em = $this->registry->getManagerForClass($configuration->getClass());
if ('SensorBundle\\Entity\\Measure' !== $em->getClassMetadata($configuration->getClass())->getName()) {
return false;
}
return true;
}
示例14: supports
/**
* {@inheritdoc}
*/
public function supports(ParamConverter $configuration)
{
if (!$configuration->getClass()) {
return false;
}
return true;
}
示例15: supports
/**
* {@inheritdoc}
*/
public function supports(ParamConverter $configuration)
{
if (!($class = $configuration->getClass())) {
return false;
}
return 'DTO' === strtoupper(substr($class, -3));
}