PHP Class PartKeepr\SetupBundle\Services\UnitSetupService

Show file Open project: partkeepr/PartKeepr

Public Methods

Method Description
__construct ( EntityManager $entityManager, Symfony\Component\HttpKernel\KernelInterface $kernel ) UnitSetupService constructor.
importUnits ( ) : array Imports units.

Protected Methods

Method Description
getSiPrefix ( string $name ) : SiPrefix | null Finds an SI Prefix by name.
getUnit ( string $name ) : Unit | null Checks if the specified SI Prefix.

Method Details

__construct() public method

UnitSetupService constructor.
public __construct ( EntityManager $entityManager, Symfony\Component\HttpKernel\KernelInterface $kernel )
$entityManager Doctrine\ORM\EntityManager
$kernel Symfony\Component\HttpKernel\KernelInterface

getSiPrefix() protected method

Finds an SI Prefix by name.
protected getSiPrefix ( string $name ) : SiPrefix | null
$name string The SI Prefix name
return PartKeepr\SiPrefixBundle\Entity\SiPrefix | null

getUnit() protected method

Checks if the specified SI Prefix.
protected getUnit ( string $name ) : Unit | null
$name string The footprint name
return PartKeepr\UnitBundle\Entity\Unit | null

importUnits() public method

Imports units.
public importUnits ( ) : array
return array An array with the keys "skipped" and "imported" which contain the number of units skipped and imported