PHP Class PartKeepr\SetupBundle\Services\FootprintSetupService

ファイルを表示 Open project: partkeepr/PartKeepr

Public Methods

Method Description
__construct ( EntityManager $entityManager, CategoryService $categoryService, UploadedFileService $uploadedFileService, Symfony\Component\HttpKernel\KernelInterface $kernel )
importFootprints ( ) : array Imports the existing footprints. Skips existing footprints.

Protected Methods

Method Description
addFootprintCategoryPath ( array $path, FootprintCategory $parentNode ) : FootprintCategory Creates a node structure for the given path.
createFootprint ( $footprintName, $footprintData )
footprintExists ( string $name ) : boolean Checks if the specified footprint exists.

Method Details

__construct() public method

public __construct ( EntityManager $entityManager, CategoryService $categoryService, UploadedFileService $uploadedFileService, Symfony\Component\HttpKernel\KernelInterface $kernel )
$entityManager Doctrine\ORM\EntityManager
$categoryService PartKeepr\CategoryBundle\Services\CategoryService
$uploadedFileService PartKeepr\UploadedFileBundle\Services\UploadedFileService
$kernel Symfony\Component\HttpKernel\KernelInterface

addFootprintCategoryPath() protected method

Creates a node structure for the given path.
protected addFootprintCategoryPath ( array $path, FootprintCategory $parentNode ) : FootprintCategory
$path array array The components of the path
$parentNode PartKeepr\FootprintBundle\Entity\FootprintCategory FootprintCategory The parent node
return PartKeepr\FootprintBundle\Entity\FootprintCategory

createFootprint() protected method

protected createFootprint ( $footprintName, $footprintData )

footprintExists() protected method

Checks if the specified footprint exists.
protected footprintExists ( string $name ) : boolean
$name string The footprint name
return boolean true if the footprints exists, false otherwise

importFootprints() public method

Imports the existing footprints. Skips existing footprints.
public importFootprints ( ) : array
return array An array with the keys "skipped" and "imported" which contain the number of footprints skipped and imported