Get a list or detail of the origin city.

@param  int|null  $province
@param  int|null  $id
@return object
187605
public function origin($province = null, $id = null)
    {
        return $this->request($this->api_version . '/internationalOrigin', [
            'province' => $province,
            'id' => $id,
        ]);
    }
605172
private function getListRepresentation($request, $id)
    {
        /** @var RestHelperInterface $restHelper */
        $restHelper = $this->get('sulu_core.doctrine_rest_helper');

        /** @var DoctrineListBuilderFactory $factory */
        $factory = $this->get('sulu_core.doctrine_list_builder_factory');

        $listBuilder = $factory->create(self::$entityName);
        $fieldDescriptors = $this->getManager()->getFieldDescriptors($this->getLocale($request));
        $restHelper->initializeListBuilder(
            $listBuilder,
            $fieldDescriptors
        );

        $listBuilder->where($fieldDescriptors['attribute_id'], $id);

        $list = new ListRepresentation(
            $listBuilder->execute(),
            self::$entityKey,
            'get_attribute_values',
            array_merge($request->query->all(), ['id' => $id]),
            $listBuilder->getCurrentPage(),
            $listBuilder->getLimit(),
            $listBuilder->count()
        );

        return $list;
    }
846965
public function view($id = null) {
		if (empty($id) || !($continent = $this->Continents->find('first', ['conditions' => ['Continent.id' => $id]]))) {
			$this->Flash->error(__('invalid record'));
			return $this->Common->autoRedirect(['action' => 'index']);
		}
		$this->set(compact('continent'));
	}
1045072
public function getPlaceById($id, array $extensions = [], $language = null)
    {
        $this->validateExtension($extensions);
        $extensions = implode(',', $extensions);

        $body = array_merge(
            ['placeid' => $id],
            !empty($extensions) ? ['extensions' => $extensions] : [],
            null !== $language ? ['language' => $language] : []
        );

        return $this->get(self::URL, $body);
    }
420406
public function getAction(Request $request, $id = null)
    {
        $locale = $this->getLocale($request);

        $snippet = $this->findDocument($id, $locale);
        $view = View::create($snippet);

        return $this->viewHandler->handle($view);
    }
879187
public function findByIdAndLocale($id, $locale)
    {
        $shipping = $this->getShippingRepository()->findByIdAndLocale($id, $locale);

        if ($shipping) {
            $apiShippings = $this->shippingFactory->createApiEntity($shipping, $locale);

            // set currently shipped items (sum of all shippings for that item)
            $shippingCounts = $this->getSumOfShippedItemsByOrderId($shipping->getOrder()->getId());
            foreach ($apiShippings->getItems() as $apiItem) {
                $itemId = $apiItem->getEntity()->getItem()->getId();
                $sum = 0;
                if (array_key_exists($itemId, $shippingCounts)) {
                    $sum = $shippingCounts[$itemId];
                }
                $apiItem->setShippedItems($sum);
            }
            return $apiShippings;
        } else {
            return null;
        }
    }
785397
public function get($id=null)
    {
      if ($id == null)
        return $this->data;


      $cname = "Catapult\\" . $this->getName();

      $obj = new $cname;

      return $obj->get($id);
    }
1331325
public function getCountry($id)
    {
        foreach ($this->data as $country) {
            if (strtoupper($id) == (string) $country) {
                return $country;
            }
        }

        return null;
    }
118678
public function get($id)
    {
        if (null === $id) {
            return;
        }

        if (isset($this->nodes[$id])) {
            return $this->nodes[$id];
        }

        $node = $this->repository->find($id);

        if (empty($node) or $node->isDeleted()) {
            return null;
        }

        return $node;
    }
1299515
public function getById($id)
    {
        $node = $this->mainNode->getById($id);
        if (!$node) {
            return null;
        }

        return $node->getData();
    }
1014575
private function load($id = null)
    {

        $this->initialize();
        $this->id = $id;
        return $this->getDataConnector()->loadContext($this);

    }
1168484
public function setCityOrigin(\Core\Entity\City $city_origin = null) {
        $this->city_origin = $city_origin;

        return $this;
    }
530771
public function getAction(Request $request, $id)
    {
        $locale = $this->getLocaleManager()->retrieveLocale($this->getUser(), $request->get('locale'));
        $view = $this->responseGetById(
            $id,
            function ($id) use ($locale){
                /** @var Shipping $shipping */
                $shipping = $this->getManager()->findByIdAndLocale($id, $locale);

                return $shipping;
            }
        );

        return $this->handleView($view);
    }
997155
public function getTree($id = null) {
        $parent = $this->getConfig('parentField');
        $left = $this->getConfig('leftField');
        $right = $this->getConfig('rightField');

        $query = $this->getRepository()->select()->orderBy($left, 'asc');

        if ($id) {
            if ($parentNode = $this->getNode($id)) {
                $query->where($left, 'between', [$parentNode[$left], $parentNode[$right]]);
            } else {
                return [];
            }
        }

        $nodes = $query->all();

        if ($nodes->isEmpty()) {
            return [];
        }

        $map = [];
        $stack = [];
        $pk = $this->getRepository()->getPrimaryKey();

        foreach ($nodes as $node) {
            if ($node[$parent] && $node[$pk] != $id) {
                $map[$node[$parent]][] = $node;
            } else {
                $stack[] = $node;
            }
        }

        $results = $this->mapTree($stack, $map);

        if ($id) {
            return $results[0];
        }

        return $results;
    }
1168231
public function getReferencedRow($id, $table, $viaColumn = null, Filtering $filtering = null)
    {
        if ($viaColumn === null) {
            $viaColumn = $this->mapper->getRelationshipColumn($this->table, $table);
        }
        $result = $this->getReferencedResult($table, $viaColumn, $filtering);
        $rowId = $this->getDataEntry($id, $viaColumn);
        return $rowId === null ? null : $result->getRow($rowId);
    }
249987
public function getLocation($id)
    {
        $url = $this->buildUrlByMethodName(
            'getGetLocationUrl',
            ['id' => $id]
        );

        return $this
            ->buildLocation(
                $this->resolveApiUrl($url)
            );
    }
328579
public function get(string $id = null): array
    {
        if ($this->has($id)) {
            return $this->cache[$id];
        }

        return [];
    }