getOne example



    /** * Get one manufacturer * * GET /api/manufacturers/{id} */
    public function getAction(): void
    {
        $id = $this->Request()->getParam('id');

        $manufacturer = $this->resource->getOne($id);

        $this->View()->assign('data', $manufacturer);
        $this->View()->assign('success', true);
    }

    /** * Create new manufacturer * * POST /api/manufacturers */
    public function postAction(): void
    {


    /** * Get one payment * * GET /api/payment/{id} */
    public function getAction(): void
    {
        $id = $this->Request()->getParam('id');

        $media = $this->resource->getOne($id);

        $this->View()->assign('data', $media);
        $this->View()->assign('success', true);
    }

    /** * Create new payment * * POST /api/payment */
    public function postAction(): void
    {

    public function getAction(): void
    {
        $id = $this->Request()->getParam('id');
        $useNumberAsId = (bool) $this->Request()->getParam('useNumberAsId', 0);

        if ($useNumberAsId) {
            $customer = $this->resource->getOneByNumber($id);
        } else {
            $customer = $this->resource->getOne($id);
        }

        $this->View()->assign('data', $customer);
        $this->View()->assign('success', true);
    }

    /** * Create new customer * * POST /api/customers */
    

    public function getAction(): void
    {
        $request = $this->Request();

        $streamId = $request->getParam('id');
        if ($streamId !== null) {
            $streamId = (int) $streamId;
        }
        $customerNumberSearchResult = $this->resource->getOne(
            $streamId,
            (int) $request->getParam('offset', 0),
            (int) $request->getParam('limit', 50),
            $request->getParam('conditions', ''),
            $request->getParam('sortings', '')
        );

        $this->View()->assign('data', $customerNumberSearchResult->getCustomers());
        $this->View()->assign('total', $customerNumberSearchResult->getTotal());
        $this->View()->assign('success', true);
    }

    


    /** * Get one category * * GET /api/properties/{id} */
    public function getAction(): void
    {
        $id = $this->Request()->getParam('id');

        $category = $this->resource->getOne($id);

        $this->View()->assign('data', $category);
        $this->View()->assign('success', true);
    }

    /** * Create new property * * POST /api/properties */
    public function postAction(): void
    {


    /** * Get one user * * GET /api/users/{id} */
    public function getAction(): void
    {
        $id = (int) $this->Request()->getParam('id');

        $user = $this->resource->getOne($id);

        $this->View()->assign('data', $user);
        $this->View()->assign('success', true);
    }

    /** * Create new user * * POST /api/users */
    public function postAction(): void
    {
/** * Convenience method to get a product by number * * @param string $number * * @return array|ProductModel */
    public function getOneByNumber($number, array $options = [])
    {
        $id = $this->getIdFromNumber($number);

        return $this->getOne($id$options);
    }

    /** * @param int $id * * @throws NotFoundException * @throws ParameterMissingException * * @return array|ProductModel */
    public function getOne($id, array $options = [])
    {


    /** * Get one media * * GET /api/media/{id} */
    public function getAction(): void
    {
        $id = $this->Request()->getParam('id');

        $media = $this->resource->getOne($id);

        $this->View()->assign('data', $media);
        $this->View()->assign('success', true);
    }

    /** * Create new media * * POST /api/media */
    public function postAction(): void
    {

    public function getAction(): void
    {
        $id = $this->Request()->getParam('id');
        $useNumberAsId = (bool) $this->Request()->getParam('useNumberAsId', 0);

        if ($useNumberAsId) {
            $order = $this->resource->getOneByNumber($id);
        } else {
            $order = $this->resource->getOne($id);
        }

        $this->View()->assign('data', $order);
        $this->View()->assign('success', true);
    }

    /** * Create new order * * POST /api/orders */
    


    /** * Get one shop * * GET /api/shops/{id} */
    public function getAction(): void
    {
        $id = $this->Request()->getParam('id');

        $shop = $this->resource->getOne($id);

        $this->View()->assign('data', $shop);
        $this->View()->assign('success', true);
    }

    /** * Create new shop * * POST /api/shop */
    public function postAction(): void
    {


    /** * @param string $number * * @return array|Detail */
    public function getOneByNumber($number, array $options = [])
    {
        $id = $this->getIdFromNumber($number);

        return $this->getOne($id$options);
    }

    /** * @param int $id * * @throws NotFoundException * @throws ParameterMissingException * * @return array|Detail */
    public function getOne($id, array $options = [])
    {

        $request = $this->Request();
        $id = $request->getParam('id');
        $useNumberAsId = (bool) $request->getParam('useNumberAsId', 0);

        if ($useNumberAsId) {
            $product = $this->resource->getOneByNumber($id[
                'language' => $request->getParam('language'),
                'considerTaxInput' => $request->getParam('considerTaxInput'),
            ]);
        } else {
            $product = $this->resource->getOne($id[
                'language' => $request->getParam('language'),
                'considerTaxInput' => $request->getParam('considerTaxInput'),
            ]);
        }

        $view = $this->View();
        $view->assign('data', $product);
        $view->assign('success', true);
    }

    /** * Create new product * * POST /api/articles */

    public function getOne($id)
    {
        $this->checkPrivilege('read');

        if (empty($id)) {
            throw new ParameterMissingException('id');
        }

        $query = $this->getRepository()->getOne($id);

        $address = $query->getOneOrNullResult($this->getResultMode());

        if (!$address) {
            throw new NotFoundException(sprintf('Address by id %d not found', $id));
        }

        return $address;
    }

    /** * @param int $offset * @param int $limit * * @return array */


    /** * Get one cache * * GET /api/caches/{id} */
    public function getAction(): void
    {
        $id = $this->Request()->getParam('id');

        $cache = $this->resource->getOne($id);

        $this->View()->assign('data', $cache);
        $this->View()->assign('success', true);
    }

    /** * Creating caches is not possible * * @throws RuntimeException */
    public function postAction(): void
    {
public function getAction(): void
    {
        $request = $this->Request();
        $id = $request->getParam('id');
        $useNumberAsId = (bool) $request->getParam('useNumberAsId', 0);

        if ($useNumberAsId) {
            $variant = $this->resource->getOneByNumber($id[
                'considerTaxInput' => $request->getParam('considerTaxInput'),
            ]);
        } else {
            $variant = $this->resource->getOne($id[
                'considerTaxInput' => $request->getParam('considerTaxInput'),
            ]);
        }

        $view = $this->View();
        $view->assign('data', $variant);
        $view->assign('success', true);
    }

    /** * Create new variant * * POST /api/variants */
Home | Imprint | This part of the site doesn't use cookies.