Finds and displays a FeatureValue entity.

@param int $featureId The feature id
@param int $id        The entity id

@throws NotFoundHttpException
@return array

@Route("/{id}")
@Method("GET")
@Template()
514729
public function showAction($featureId, $id)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var Feature $feature */
        $feature = $em->getRepository('EcommerceBundle:Feature')->find($featureId);

        if (!$feature) {
            throw $this->createNotFoundException('Unable to find Feature entity.');
        }

        /** @var FeatureValue $entity */
        $entity = $em->getRepository('EcommerceBundle:FeatureValue')->find($id);

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find FeatureValue entity.');
        }

        $deleteForm = $this->createDeleteForm($featureId, $id);

        return array(
            'entity'      => $entity,
            'feature'   => $feature,
            'delete_form' => $deleteForm->createView(),
        );
    }
1082561
public int getFeatureShapeCount(String database, String table, long featureId) {
        return getFeatureShape(database, table, featureId).count();
    }
739308
public function setFeatureId($v)
    {
        if ($v !== null) {
            $v = (int) $v;
        }

        if ($this->feature_id !== $v) {
            $this->feature_id = $v;
            $this->modifiedColumns[FeatureFeatureTypeTableMap::FEATURE_ID] = true;
        }

        if ($this->aFeature !== null && $this->aFeature->getId() !== $v) {
            $this->aFeature = null;
        }


        return $this;
    }
221400
public function get($id)
    {
        if ($this->has($id)) {
            return $this->make($id);
        }

        throw new ContainerValueNotFoundException(sprintf(
            'Identifier "%s" is not defined.',
            $id
        ));
    }
971017
public function actionViewAjax($id)
    {
        $model = Article::findOne($id);
        if( $model === null ) throw new NotFoundHttpException("None exists article id");
        return [
            'likeCount' => (int)$model->getArticleLikeCount(),
            'scanCount' => $model->scan_count * 100,
            'commentCount' => $model->comment_count,
        ];
    }
1153477
public function newAction($featureId)
    {
        $em = $this->getDoctrine()->getManager();

        /** @var Feature $feature */
        $feature = $em->getRepository('EcommerceBundle:Feature')->find($featureId);

        if (!$feature) {
            throw $this->createNotFoundException('Unable to find Feature entity.');
        }

        $entity = new FeatureValue();
        $form   = $this->createForm(new FeatureValueType(), $entity);

        return array(
            'entity'      => $entity,
            'feature'   => $feature,
            'form'        => $form->createView(),
        );
    }
434829
protected function getPage($id)
    {
        $page = $this->pageManager->findOneBy(['id' => $id]);

        if (null === $page) {
            throw new NotFoundHttpException(sprintf('Page (%d) not found', $id));
        }

        return $page;
    }
1005798
def getFeatureById(self, featureId):
        
        sql = "SELECT * FROM FEATURE WHERE id = ?"
        query = self._dbconn.execute(sql, (featureId,))
        ret = query.fetchone()
        if ret is None:
            return None
        return sqlite_backend.sqliteRowToDict(ret)
1044775
public static function get(int $featureAnnouncementId, array $customHeaders = []): BunqResponseFeatureAnnouncement
    {
        $apiClient = new ApiClient(static::getApiContext());
        $responseRaw = $apiClient->get(
            vsprintf(
                self::ENDPOINT_URL_READ,
                [static::determineUserId(), $featureAnnouncementId]
            ),
            [],
            $customHeaders
        );

        return BunqResponseFeatureAnnouncement::castFromBunqResponse(
            static::fromJson($responseRaw, self::OBJECT_TYPE_GET)
        );
    }
776645
public function getPageThemeById($id, $mode = AbstractQuery::HYDRATE_OBJECT)
    {
        $qb = $this->getEntityManager()->createQueryBuilder();
        /** @var $query \Doctrine\ORM\Query */

        $query = $qb->select('e, m')
            ->from($this->getEntity(), 'e')
            ->innerJoin('e.pageId', 'm')
            ->where('e.id = :id')
            ->setMaxResults(1)
            ->setParameter('id', $id)
            ->getQuery();

        return $query->getOneOrNullResult($mode);
    }
469541
public function get($id)
    {
        if (!is_string($id)) {
            throw new ContainerException('$id must be a string');
        }

        if (!isset($this->definitions[$id])) {
            throw new NotFoundException("Unresolvable ".$id);
        }

        return $this->definitions[$id];
    }
1075989
public function findModel($id)
    {
        $model = $this->findModelClassObject($this->modelClass, $id, 'view');
        
        if (!$model) {
            throw new NotFoundHttpException("Unable to find the Model for the given ID");
        }
        
        return $model;
    }
611820
public function find($documentId, $forceClear = false)
    {
        if ($forceClear) {
            $this->repository->clear();
        }
        $result = $this->repository->find($documentId);

        if (empty($result)) {
            throw new NotFoundException("Entry with id " . $documentId . " not found!");
        }

        return $result;
    }
99433
public function getFeatureVariableFromKey($featureFlagKey, $variableKey)
    {
        $featureFlag = $this->getFeatureFlagFromKey($featureFlagKey);
        if ($featureFlag && !($featureFlag->getKey())) {
            return null;
        }

        if (isset($this->_featureFlagVariableMap[$featureFlagKey])
            && isset($this->_featureFlagVariableMap[$featureFlagKey][$variableKey])
        ) {
            return $this->_featureFlagVariableMap[$featureFlagKey][$variableKey];
        }

        $this->_logger->log(
            Logger::ERROR,
            sprintf(
                'No variable key "%s" defined in datafile for feature flag "%s".',
                $variableKey,
                $featureFlagKey
            )
        );
        $this->_errorHandler->handleError(
            new InvalidFeatureVariableException('Provided feature variable is not in datafile.')
        );
        return null;
    }
792142
public function updateOne(int $featureId, $value, string $type) : array {
        return $this->sendPatch(
            sprintf('/profiles/%s/features/%s', $this->userName, $featureId),
            [],
            [
                'value' => $value,
                'type'  => $type
            ]
        );
    }
1248898
public function retrieve($id)
    {
        // First get the models using the resource specified in the database
        // using the appropriate connection
        $valueSet = ValueSet::find($id);
        $resource = $valueSet->resource;
        $connection = $valueSet->connection;
        $repositoryClass = $this->repositoryPath . ucfirst($resource) . 'Repository';
        $repository = new $repositoryClass();
        $repository->setConnection($connection);
        $models = array();
        if ( $valueSet->resource == 'Options' ) {
            $models = $repository->fetchOptionsByKey( $valueSet->key );
        } else if ( $valueSet->resource == 'ListOptions' ) {
            $models = $repository->fetchOptionsByListId( $valueSet->key );
        } else {
            $models = $repository->fetchAll();
        }

        // Create the value set and expansion to fill with the model data
        $FHIRValueSet = new FHIRValueSet();
        $valueSetID = new FHIRString();
        $valueSetID->setValue('test_id');
        $FHIRValueSet->setId($valueSetID);
        $text = new FHIRNarrative();
        $div = new FHIRString();
        $div->setValue("<div>\n      <h3>Value Set Contents</h3>\n      <p>This value set contains 3 concepts</p>\n      <table class=\"codes\">\n        <tr>\n          <td>\n            <b>Code</b>\n          </td>\n          <td>\n            <b>System</b>\n          </td>\n          <td>\n            <b>Display</b>\n          </td>\n        </tr>\n        <tr>\n          <td>\n            <a name=\"http---hl7.org-fhir-v2-0136-Y\"> </a>\n            <a href=\"v2/0136/index.html#Y\">Y</a>\n          </td>\n          <td>http://hl7.org/fhir/v2/0136</td>\n          <td>Yes</td>\n        </tr>\n        <tr>\n          <td>\n            <a name=\"http---hl7.org-fhir-v2-0136-N\"> </a>\n            <a href=\"v2/0136/index.html#N\">N</a>\n          </td>\n          <td>http://hl7.org/fhir/v2/0136</td>\n          <td>No</td>\n        </tr>\n        <tr>\n          <td>\n            <a name=\"http---hl7.org-fhir-data-absent-reason-asked\"> </a>\n            <a href=\"valueset-data-absent-reason.html#asked\">asked</a>\n          </td>\n          <td>http://hl7.org/fhir/data-absent-reason</td>\n          <td>Don't know</td>\n        </tr>\n      </table>\n      <h2>Yes/No/Don't Know</h2>\n      <p>For Capturing simple yes-no-don't know answers</p>\n      <p>This value set includes codes from the following code systems:</p>\n      <ul>\n        <li>Import all the codes that are contained in \n          <a href=\"v2/0136/index.html\">http://hl7.org/fhir/ValueSet/v2-0136</a>\n        </li>\n        <li>Include these codes as defined in \n          <a href=\"valueset-data-absent-reason.html\">http://hl7.org/fhir/data-absent-reason</a>\n          <table>\n            <tr>\n              <td>\n                <b>Code</b>\n              </td>\n              <td>\n                <b>Display</b>\n              </td>\n            </tr>\n            <tr>\n              <td>asked</td>\n              <td>Don't know</td>\n              <td>The source human does not know the value.</td>\n            </tr>\n          </table>\n        </li>\n      </ul>\n    </div>");
        $text->setDiv($div);

        $narrativeStatus = new FHIRString();
        $narrativeStatus->setValue("generated");
        $text->setStatus($narrativeStatus);
        $FHIRValueSet->setText($text);

        $url = new FHIRString();
        $url->setValue($valueSet->getValueSetUrl());
        $FHIRValueSet->setUrl($url);
        $name = new FHIRString();
        $name->setValue($valueSet->getValueSetName());
        $FHIRValueSet->setName($name);
        $status = new FHIRString();
        $status ->setValue("draft");
        $FHIRValueSet->setStatus($status);
        $description = new FHIRString();
        $description->setValue($valueSet->getValueSetDescription());
        $FHIRValueSet->setDescription($description);
        $compose = new FHIRValueSetCompose();
        $import = new FHIRString();
        $import->setValue("http://hl7.org/fhir/ValueSet/v2-0136");
        $compose->addImport($import);
        
        $concept =  new FHIRCoding();
        $code = new FHIRString();
        $code->setValue("asked");
        $concept->setCode($code);
        $display = new FHIRString();
        $display->setValue("Don't know");

        $include = new FHIRValueSetInclude();
        $system = new FHIRString();
        $system->setValue("http://hl7.org/fhir/data-absent-reason");
        $include->setSystem($system);
        $include->addConcept($concept);
        $concept->setDisplay($display);

        $compose->addInclude($include);

        $FHIRValueSet->setCompose($compose);

        $FHIRExpansion = new FHIRValueSetExpansion();
        $timestamp = new FHIRString();
        $timestamp->setValue(date("Y-m-d H:i:s"));
        $FHIRExpansion->setTimestamp($timestamp);
        $identifier = new FHIRString();
        $identifier->setValue(uniqid($resource . '_'));
        $FHIRExpansion->setIdentifier($identifier);

        foreach ($models as $model) {
            if ($model instanceof ValueSetInterface) {

                // Models that implement ValueSetInterface are
                // capable of exporting the name (for display field), code
                // So that they conform to the ValueSetInterface
                // and properly fill the ValueSet->expansion->contains[]
                $FHIRContains = new FHIRValueSetContains();
                $display = new FHIRString();
                $display->setValue($model->getName());
                $code = new FHIRString();
                $code->setValue($model->getCode());
                $system = new FHIRString();
                $system->setValue(\URL::current());

                $FHIRContains->setDisplay($display);
                $FHIRContains->setCode($code);
                $FHIRContains->setSystem($system);
                $FHIRExpansion->addContains($FHIRContains);
            }
        }

        return $FHIRValueSet->setExpansion($FHIRExpansion);
    }
859633
public function getModel($id)
    {
        if (!is_array($id)) {
            $id = [$id];
        }

        $model = call_user_func($this->findModel, $id);
        if ($model === null) {
            throw new NotFoundHttpException('The requested page does not exist.');
        }

        return $model;
    }