src/Builder/VariableFormBuilder.php
public function getFilesCount(string $slug)
    {
        if (/*!$this->filesCountBySlug &&*/ $this->structure)
        {
            $result = [];

            $files = $this->structureValueFileRepository
                ->findByRecipeAndStructure($this->recipe, $this->structure);

            foreach ($files as $structureValueFile)
            {
                $dbSlug = $structureValueFile->getStructureValue()->getRecipeVariable()->getSlug();
                $result[$dbSlug][] = $structureValueFile;
            }

            $this->filesCountBySlug = $result;
        }

        if (key_exists($slug, $this->filesCountBySlug))
        {
            return count($this->filesCountBySlug[$slug]);
        }

        return 0;

    }
public function getFilesCount(string $slug)
    {
        if (/*!$this->filesCountBySlug &&*/ $this->structure)
        {
            $result = [];

            $files = $this->structureValueFileRepository
                ->findByRecipeAndStructure($this->recipe, $this->structure);

            foreach ($files as $structureValueFile)
            {
                $dbSlug = $structureValueFile->getStructureValue()->getRecipeVariable()->getSlug();
                $result[$dbSlug][] = $structureValueFile;
            }

            $this->filesCountBySlug = $result;
        }

        if (key_exists($slug, $this->filesCountBySlug))
        {
            return count($this->filesCountBySlug[$slug]);
        }

        return 0;

    }
TODO: load in Form Control
Cashed SQL
@param string $slug
@return int
@throws \Propel\Runtime\Exception\PropelException