@param string $name

@throws \Spryker\Zed\DataImport\Business\Exception\EntityNotFoundException

@return int
500358
protected function getIdProductPackagingUnitTypeByName(string $name): int
    {
        if (isset(static::$idProductPackagingUnitTypeHeap[$name])) {
            return static::$idProductPackagingUnitTypeHeap[$name];
        }

        throw new EntityNotFoundException(sprintf("Product packaging unit type '%s' was not found", $name));
    }
109319
protected function channelOrFail($name)
    {
        if (isset($this->channels[$name])) {
            return $this->channels[$name];
        }
        throw new ResourceNotFoundException("Channel $name is not known.");
    }
965982
public function findOneByName($name)
    {
        $qb = $this->getQueryBuilder();

        return $qb
            ->andWhere($qb->expr()->eq('b.name', ':name'))
            ->andWhere($qb->expr()->isNull('b.row'))
            ->getQuery()
            ->useQueryCache(true)
            // TODO ->useResultCache(true, 3600, Block::getEntityTagPrefix() . '[name:'.$name.']')
            ->setParameter('name', $name)
            ->getOneOrNullResult();
    }
1239131
public function getValue(string $name)
	{
		if(array_key_exists($name, $this->columns))
		{
			// It's a database column

			return $this->getColumnValue($name);
		}
		elseif(array_key_exists($name, $this->related))
		{
			// The column is a cached or eagerly loaded relation

			return $this->related[$name];
		}
		elseif($this->isRelation($name))
		{
			// The column is a relation. Lazy load the record(s) and cache them

			return $this->related[$name] = $this->$name()->getRelated();
		}

		// All options have been exhausted so we'll throw an exception

		throw new RuntimeException(vsprintf('Unknown column or relation [ %s ].', [$name]));
	}
1075763
public function getIntValue($name):?int
    {
        $value = $this->offsetGet($name);
        if (is_null($value)) {
            return null;
        }

        return (int)$value;
    }
617401
protected function loadCollaction($name, $entityName, $fields)
    {
        $em = $this->getContainer()->get('doctrine')->getManager();
        $entityRepository = $em->getRepository($entityName);

        $meta = $em->getClassMetadata($entityName);
        $identifier = $meta->getSingleIdentifierFieldName();
        $identifierMethodName = 'get'.ucfirst($identifier);

        $collection = $entityRepository->findAll();

        $result = array();

        foreach ($collection as $item) {
            $element = array();

            foreach ($fields as $fieldName => $attributes) {
                $methodName = 'get'.ucfirst($fieldName);
                $fieldValue = $item->$methodName();

                $value = null;

                if (is_object($fieldValue)) {
                    if (get_class($fieldValue) === 'DateTime') {
                        $value = array('type' => 'DateTime', 'name' => $fieldValue->format('r'));
                    } elseif (array_key_exists('targetEntity', $attributes)) {
                        $targetClassName = $meta->associationMappings[$fieldName]['targetEntity'];
                        $targetEntityProvider = new EntityProvider($targetClassName);

                        $targetMethodName = 'get'.ucfirst($em->getClassMetadata($targetClassName)->identifier[0]);
                        $value = array(
                            'type' => 'reference',
                            'name' => $targetEntityProvider->getName().'_'.$fieldValue->$targetMethodName(),
                        );
                    } else {
                        throw new \Exception('aaa');
                    }
                } else {
                    $value = $fieldValue;
                }

                $element[$fieldName] = $value;
            }

            $result[$name.'_'.$item->$identifierMethodName()] = $element;
        }

        return $result;
    }
425990
public function countOfType(string $name): int
    {
        $oid = AttributeType::attrNameToOID($name);
        return array_sum(
            array_map(
                function (RDN $rdn) use ($oid) {
                    return count($rdn->allOf($oid));
                }, $this->_rdns));
    }
695230
protected function getStoreIdByName($name): int
    {
        if (!isset(static::$storeIdsCache[$name])) {
            static::$storeIdsCache[$name] = SpyStoreQuery::create()
                ->findOneByName($name)
                ->getIdStore();
        }

        return static::$storeIdsCache[$name];
    }
1229250
public function getRawSQLName($name)
    {
        $names = $this->metadata[Metadata::RAW_NAMES];
        
        if (isset($names[$name]))
            return $names[$name];
        
        throw new NotFoundException('Cannot found real column name for ":name"', ['name' => $name]);
    }
1351443
public function &__get($name) {
    if ($name === 'guid') {
      return $this->$name;
    }
    if ($this->isASleepingReference) {
      $this->referenceWake();
    }
    if ($name === 'cdate'
        || $name === 'mdate'
        || $name === 'tags'
      ) {
      return $this->$name;
    }
    // Unserialize.
    if (isset($this->sdata[$name])) {
      $this->data[$name] = unserialize($this->sdata[$name]);
      unset($this->sdata[$name]);
    }
    // Check for an entity first.
    if (isset($this->entityCache[$name])) {
      if ($this->data[$name][0] === 'nymph_entity_reference') {
        if ($this->entityCache[$name] === 0) {
          // The entity hasn't been loaded yet, so load it now.
          $className = $this->data[$name][2];
          if (!class_exists($className)) {
            throw new Exceptions\EntityCorruptedException(
                "Entity reference refers to a class that can't be found, ".
                "$className."
            );
          }
          $this->entityCache[$name] =
              $className::factoryReference($this->data[$name]);
          $this->entityCache[$name]->useSkipAc($this->useSkipAc);
        }
        return $this->entityCache[$name];
      } else {
        throw new Exceptions\EntityCorruptedException(
            "Entity data has become corrupt and cannot be determined."
        );
      }
    }
    // Check if it's set.
    if (!isset($this->data[$name])) {
      // Since we must return by reference, we have to use a constant here. If
      // we return $this->data[$name], an entry will be created in data.
      return $this->NULL_CONST;
    }
    // If it's not an entity, return the regular value.
    try {
      if (is_array($this->data[$name])) {
        // But, if it's an array, check all the values for entity references,
        // and change them.
        array_walk($this->data[$name], [$this, 'referenceToEntity']);
      } elseif (is_object($this->data[$name])
                && !(
                  (
                    is_a($this->data[$name], '\Nymph\Entity')
                    || is_a($this->data[$name], '\SciActive\HookOverride')
                  )
                  && is_callable([$this->data[$name], 'toReference'])
                )) {
        // Only do this for non-entity objects.
        foreach ($this->data[$name] as &$curProperty) {
          $this->referenceToEntity($curProperty, null);
        }
        unset($curProperty);
      }
    } catch (Exceptions\EntityClassNotFoundException $e) {
      throw new Exceptions\EntityCorruptedException($e->getMessage());
    }
    return $this->data[$name];
  }
1321807
public function getIndexByName($name)
    {
        foreach ($this->sections as $i => $sec) {
            if ($sec instanceof Section) {
                if ($sec->getName() == $name) {
                    return $i;
                }
            }
        }
        return -1;
    }
815867
protected function getEntity($entityId)
    {
        $entity = $this->getRepository()->get($entityId);
        if (!$entity instanceof EntityInterface) {
            throw new EntityNotFoundException(
                "There are no entities with provided entity ID."
            );
        }
        return $entity;
    }
48752
public function getIndex(string $name)
    {
        if (!isset($this->indexes[$name])) {
            Throw new IndexException(sprintf('A field named "%s" does not exist in this table', $name));
        }

        return $this->indexes[$name];
    }
1034091
protected function findIdCompanyBusinessUnit(string $companyBusinessUnitKey): int
    {
        if (!isset($this->idCompanyBusinessUnitCache[$companyBusinessUnitKey])) {
            $idCompanyBusinessUnit = SpyCompanyBusinessUnitQuery::create()
                ->select(SpyCompanyBusinessUnitTableMap::COL_ID_COMPANY_BUSINESS_UNIT)
                ->findOneByKey($companyBusinessUnitKey);

            if (!$idCompanyBusinessUnit) {
                throw new EntityNotFoundException(sprintf('Could not find Company Business Unit by key "%s"', $companyBusinessUnitKey));
            }

            $this->idCompanyBusinessUnitCache[$companyBusinessUnitKey] = $idCompanyBusinessUnit;
        }

        return $this->idCompanyBusinessUnitCache[$companyBusinessUnitKey];
    }
95730
protected function whatToDoWithEntity(): int
    {
        $this->checkEntityIsInConfig();

        $entityConfig = $this->configEntities[$this->entity];

        $actions = 0;
        if (array_key_exists('cols', $entityConfig)) {
            switch ($entityConfig['action']) {
                case 'update':
                    $actions |= self::UPDATE_TABLE;
                    break;
                case 'insert':
                    $actions |= self::INSERT_TABLE;
                    break;
            }
        }

        return $actions;
    }
912398
public function getCondition($name)
    {
        if (false === $this->hasCondition($name)) {
            throw EntryNotFoundException::activationConditionNotFound($name);
        }

        $items = $this->getConditions();

        return $items[$name];
    }
618775
protected function getQueueId($name)
    {
        $r = $this->db->fetchColumn('select queue_id from Queues where queue_name = ? limit 1', [$name]);

        if ($r === false) {
            throw new RuntimeException(t('Queue does not exist: %s', $name));
        }

        $count = (int) $r;

        return $count;
    }