public function execute(InputInterface $input, OutputInterface $output) { $entities = ['PartKeepr\\FootprintBundle\\Entity\\FootprintCategory', 'PartKeepr\\PartBundle\\Entity\\PartCategory', 'PartKeepr\\StorageLocationBundle\\Entity\\StorageLocationCategory']; foreach ($entities as $entity) { $this->regenerateCategoryPaths($entity); } }