@param RequestEntity $requestEntity

@return \yii\httpclient\Request
493161
protected function createHttpRequest(RequestEntity $requestEntity) {
		$requestEntity->validate();
		$httpClient = new Client();
		$httpClient->baseUrl = $this->getBaseUrl();
		$request = $httpClient->createRequest();
		$request
			->setOptions($requestEntity->options)
			->setMethod($requestEntity->method)
			->setUrl($requestEntity->uri)
			->setData($requestEntity->data)
			->setHeaders($requestEntity->headers)
			->addHeaders(['user-agent' => 'Awesome-Octocat-App']);
		return $request;
	}
828043
public static function fromSymfonyRequest(Request $request) {
		if (!$request->headers->has('C-AAUID') || !$request->headers->has('C-Access-Token'))
			return null;

		$context = new AccountContext(
			new IRI('aauid:'.$request->headers->get('C-AAUID')),
			$request->headers->get('C-Access-Token'));

		$psr7Factory = new DiactorosFactory;
		$context->parsePsrRequest($psr7Factory->createRequest($request));

		return $context;
	}
1278424
public function updateCustomer(Update\RequestData $requestData)
    {
        $request = new Update\Request($requestData);

        return $this->sendRequest($request, Update\ApiResponse::class);
    }
688609
public function createEntityRequest(
        RequestInterface $request,
        ContainerInterface $container
    ): EntityRequestInterface
    {
        /** @var EntityRequestInterface $er */
        $er = new $this->entityRequest($request);
        $er->setContainer($container);

        return $er;
    }
674451
public function setEntityLoaderRepository($entityLoaderRepository)
    {
        // force mode
        $this->setEntityLoaderMode(self::ENTITY_LOADER_REPOSITORY);

        $this->entityLoaderRepository = $entityLoaderRepository;

        return $this;
    }
722162
protected function makeRequest($requestType, $uri)
    {
        $this->crawler = $this->client()->request('GET', $uri);

        $this->clearInputs()->assertPageLoaded($uri);

        return $this;
    }
1185394
public function createAction(Request $request)
    {
        $class = $this->admin->getEntity();
        $data = new $class();

        return $this->editAction($request, $data);
    }
506813
public function ajaxAction(Request $request)
    {
        $parentId = $request->query->get('id');
        $entityName = $request->query->get('entityName');
        $currentId = $request->query->get('currentId');

        $em = $this->getDoctrine()->getManager();
        $filter = array(
            'parent' => null,
        );

        if (intval($parentId)) {
            $filter['parent'] = $em->getReference($entityName, (int) $parentId);
        }

        $items = $this->getDoctrine()
            ->getRepository($entityName)
            ->findBy($filter);

        $data = array_map(function (Taxonomy $item) use ($currentId) {
            return array(
                'id' => $item->getId(),
                'text' => $item->getNode()->getTitle(),
                'children' => true,
                'state' => array(
                    'disabled' => ($item->getId() != $currentId),
                ),
            );
        }, $items);

        if (!$currentId && is_null($filter['parent'])) {
            $data[] = array(
                'id' => 'current',
                'text' => 'New Item',
                'children' => false,
                'state' => array(
                    'disabled' => false,
                ),
            );
        }

        return new JsonResponse($data);
    }
640603
public function load(AbstractDbEntity $dbEntity)
    {
        // Check that the primary key is set
        if (!$dbEntity->getPrimaryDbValue()) {
            throw new \InvalidArgumentException(
                'Database entity can not be loaded because primary value is not set'
            );
        }

        // Fetch ad from db
        $row = $this->db->fetchRow(
            '
                SELECT *
                FROM `' . $dbEntity->getDbTableName() . '`
                WHERE ' . $this->getPrimaryKeyWhereSql($dbEntity) . '
            ',
            $this->getPrimaryKeyWhereParameters($dbEntity)
        );

        if (!$row) {
            throw new Exception\EntityNotFoundException("Db entity[{$dbEntity->getPrimaryDbValue()}] does not exist");
        }

        $dbEntity->setDbDataFromRow($row);
    }
967995
public function getClientId($clientId = null)
    {

        // Return given parameter
        if ($clientId) {
            return $clientId;
        }

        // If clientId is null and no clientId has previously been set
        if (!$this->clientId) {
            throw new RequestRequiresClientIdException();
        }

        // Return clientId that has previously been set
        return $this->clientId;
    }
359621
@Override
    protected RequestEntity generateRequestEntity() {
        if (!this.params.isEmpty()) {
            // Use a ByteArrayRequestEntity instead of a StringRequestEntity.
            // This is to avoid potential encoding issues.  Form url encoded strings
            // are ASCII by definition but the content type may not be.  Treating the content
            // as bytes allows us to keep the current charset without worrying about how
            // this charset will effect the encoding of the form url encoded string.
            String content = EncodingUtil.formUrlEncode(getParameters(), getRequestCharSet());
            ByteArrayRequestEntity entity = new ByteArrayRequestEntity(
                EncodingUtil.getAsciiBytes(content),
                FORM_URL_ENCODED_CONTENT_TYPE
            );
            return entity;
        }
        return super.generateRequestEntity();
    }
461109
public function execute(RequestInterface $request): RequestInterface
    {
        if ($request->getUri()->getPath() === self::ENDPOINT_INSTALLATION) {
            return $request;
        } else {
            $signature = $this->determineRequestSignature(
                $request->getUri(),
                $request->getMethod(),
                $request->getBody()->getContents(),
                $request->getHeaders()
            );

            return $request->withHeader(self::HEADER_CLIENT_SIGNATURE, $signature);
        }
    }
727811
public function createAction(Request $request)
    {
        $entity = new User();
        $form = $this->createCreateForm($entity);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $userService = $this->get("flowcode.user");
            $userService->create($entity);

            return $this->redirect($this->generateUrl('admin_user_show', array('id' => $entity->getId())));
        }

        return array(
            'entity' => $entity,
            'form' => $form->createView(),
        );
    }
1046402
private function getTaxonomyEntity(Entity\Content $contentEntity, $taxonomy)
    {
        return new Entity\Taxonomy([
            'content_id'   => $contentEntity->getId(),
            'contenttype'  => (string) $contentEntity->getContentType(),
            'taxonomytype' => $taxonomy,
        ]);
    }
255319
public function getActionRequestMeta($action, Entity $entity = NULL, $method = \Psc\Net\HTTP\Request::GET) {
    if (!array_key_exists($action, $this->actionsRequestMeta)) {
      $idIsInt = ($identifierType = $this->getIdentifier()->getType()) instanceof IntegerType;
      $this->actionsRequestMeta[$action] = new RequestMeta($method,
                                               $this->constructUrl(array($this->getEntityName(), ($idIsInt ? '%d' : '%s'), $action)),
                                               array($identifierType)
                                              );
    }
    
    if (isset($entity)) {
      $meta = clone $this->actionsRequestMeta[$action];
      return $meta->setInput($entity->getIdentifier());
    } else {
      return $this->actionsRequestMeta[$action];
    }
  }
85769
public function searchFillerAction(Request $request)
    {
        /* @var $chain ChainFiller */
        $chain = $this->get('anime_db.plugin.filler');
        $response = $this->getResponseFromChain($chain);

        // response was not modified for this request
        if ($response->isNotModified($request)) {
            return $response;
        }

        $entity = new SearchFiller($chain);
        /* @var $form Form */
        $form = $this->createForm(new SearchFillerForm(), $entity)->handleRequest($request);
        if ($form->isValid()) {
            return $this->redirect($entity->getFiller()->getLinkForFill($entity->getUrl()));
        }

        return $this->render('AnimeDbCatalogBundle:Fill:search_filler.html.twig', [
            'form' => $form->createView(),
        ], $response);
    }
1257337
public static function newInstance(Entity_Interface $realEntity)
  {
    $basename = $realEntity->basename();
    $path = $realEntity->path();

    $instance = new static($basename, $path);
    /* @var $instance Entity_Deleted */
    $instance->_realEntity = $realEntity;

    return $instance;
  }