PHP Class PartKeepr\PartBundle\Entity\Part

Inheritance: extends PartKeepr\CoreBundle\Entity\BaseEntity
Afficher le fichier Open project: partkeepr/PartKeepr Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( )
addAttachment ( PartAttachment $partAttachment ) Adds a Part Attachment.
addDistributor ( PartDistributor $partDistributor ) Adds a Part Distributor.
addManufacturer ( PartManufacturer $partManufacturer ) Adds a Part Manufacturer.
addStockLevel ( StockEntry $stockEntry ) Adds a new stock entry to this part.
executeSaveListener ( )
getAttachments ( ) : ArrayCollection Returns the part attachments array.
getAveragePrice ( ) : float Returns the acrage price.
getCategory ( ) : PartCategory Returns the assigned category.
getCategoryPath ( ) : string Returns the category path.
getComment ( ) : string Returns the comment for this part.
getCreateDate ( ) : DateTime Returns the create date.
getDescription ( ) : string Returns the short description of this part.
getDistributors ( ) : ArrayCollection Returns the distributors array.
getFootprint ( ) Retrieves the footprint.
getInternalPartNumber ( ) : string Returns the internal part number for this part.
getManufacturers ( ) : ArrayCollection Returns the manufacturers array.
getMinStockLevel ( ) : integer Returns the minimum stock level.
getName ( ) : string Returns the name of this part.
getNeedsReview ( ) : boolean Returns the review flag.
getParameters ( ) : array Returns the parameters assigned to this part.
getPartCondition ( ) : string Returns the condition of this part.
getPartUnit ( ) : PartMeasurementUnit Returns the part unit.
getProjectNames ( ) : array Returns the project names this part is used in.
getProjectParts ( ) : ArrayCollection Returns the project parts.
getStatus ( ) : string Returns the status for this part.
getStockLevel ( ) : integer Returns the stock level.
getStockLevels ( ) : ArrayCollection Returns all stock entries.
getStorageLocation ( ) : StorageLocation Returns the storage location for this part.
hasRemovals ( ) : mixed
isLowStock ( ) : boolean
onPrePersist ( ) Checks if the requirements for database persisting are given.
onPreUpdate ( ) Checks if the requirements for database persisting are given.
recomputeStockLevels ( )
removeAttachment ( PartAttachment $partAttachment ) Removes a Part Attachment.
removeDistributor ( PartDistributor $partDistributor ) Removes a part distributor.
removeManufacturer ( PartManufacturer $partManufacturer ) Removes a part manufacturer.
removeStockLevel ( StockEntry $stockEntry ) Removes a stock entry from this part.
setAveragePrice ( float $price ) Sets the average price for this part.
setCategory ( PartCategory $category ) Sets the category for this part.
setComment ( string $comment ) Sets the comment for this part.
setDescription ( string $description ) Sets the description for this part.
setFootprint ( Footprint $footprint = null ) Sets the footprint for this part.
setInternalPartNumber ( string $partNumber ) Sets the internal part number for this part.
setLowStock ( boolean $lowStock )
setMinStockLevel ( integer $minStockLevel ) Set the minimum stock level for this part.
setName ( string $name ) Sets the name for this part.
setNeedsReview ( boolean $bReview ) Sets the review flag.
setPartCondition ( string $partCondition ) Sets the condition for this part.
setPartUnit ( PartMeasurementUnit $partUnit ) Sets the part unit.
setRemovals ( mixed $removals = false )
setStatus ( string $status ) Sets the status for this part. A status is any string describing the status, e.g. "new", "used", "broken" etc.
setStockLevel ( $stockLevel ) Sets the stock level.
setStorageLocation ( StorageLocation $storageLocation ) Sets the storage location for this part.

Private Methods

Méthode Description
checkCategoryConsistency ( ) Checks if the part category is set.
checkStorageLocationConsistency ( ) Checks if the part storage location is set.
setCreateDate ( DateTime $dateTime ) Sets the create date for this part.

Method Details

__construct() public méthode

public __construct ( )

addAttachment() public méthode

Adds a Part Attachment.
public addAttachment ( PartAttachment $partAttachment )
$partAttachment PartAttachment An attachment to add

addDistributor() public méthode

Adds a Part Distributor.
public addDistributor ( PartDistributor $partDistributor )
$partDistributor PartDistributor A part distributor to add

addManufacturer() public méthode

Adds a Part Manufacturer.
public addManufacturer ( PartManufacturer $partManufacturer )
$partManufacturer PartManufacturer A part manufacturer to add

addStockLevel() public méthode

Adds a new stock entry to this part.
public addStockLevel ( StockEntry $stockEntry )
$stockEntry PartKeepr\StockBundle\Entity\StockEntry

executeSaveListener() public méthode

public executeSaveListener ( )

getAttachments() public méthode

Returns the part attachments array.
public getAttachments ( ) : ArrayCollection
Résultat Doctrine\Common\Collections\ArrayCollection the part attachments

getAveragePrice() public méthode

Returns the acrage price.
public getAveragePrice ( ) : float
Résultat float

getCategory() public méthode

Returns the assigned category.
public getCategory ( ) : PartCategory
Résultat PartCategory

getCategoryPath() public méthode

Returns the category path.
public getCategoryPath ( ) : string
Résultat string

getComment() public méthode

Returns the comment for this part.
public getComment ( ) : string
Résultat string The comment

getCreateDate() public méthode

Returns the create date.
public getCreateDate ( ) : DateTime
Résultat DateTime The create date+time

getDescription() public méthode

Returns the short description of this part.
public getDescription ( ) : string
Résultat string The part description

getDistributors() public méthode

Returns the distributors array.
public getDistributors ( ) : ArrayCollection
Résultat Doctrine\Common\Collections\ArrayCollection the distributors

getFootprint() public méthode

Retrieves the footprint.
public getFootprint ( )

getInternalPartNumber() public méthode

Returns the internal part number for this part.
public getInternalPartNumber ( ) : string
Résultat string the internal part number

getManufacturers() public méthode

Returns the manufacturers array.
public getManufacturers ( ) : ArrayCollection
Résultat Doctrine\Common\Collections\ArrayCollection the manufacturers

getMinStockLevel() public méthode

Returns the minimum stock level.
public getMinStockLevel ( ) : integer
Résultat integer

getName() public méthode

Returns the name of this part.
public getName ( ) : string
Résultat string The part name

getNeedsReview() public méthode

Returns the review flag.
public getNeedsReview ( ) : boolean
Résultat boolean True if the part needs review, false otherwise

getParameters() public méthode

Returns the parameters assigned to this part.
public getParameters ( ) : array
Résultat array An array of PartParameter objects

getPartCondition() public méthode

Returns the condition of this part.
public getPartCondition ( ) : string
Résultat string The part condition

getPartUnit() public méthode

Returns the part unit.
public getPartUnit ( ) : PartMeasurementUnit
Résultat PartMeasurementUnit The part unit object

getProjectNames() public méthode

Returns the project names this part is used in.
public getProjectNames ( ) : array
Résultat array

getProjectParts() public méthode

Returns the project parts.
public getProjectParts ( ) : ArrayCollection
Résultat Doctrine\Common\Collections\ArrayCollection

getStatus() public méthode

Returns the status for this part.
public getStatus ( ) : string
Résultat string The status

getStockLevel() public méthode

Returns the stock level.
public getStockLevel ( ) : integer
Résultat integer The stock level

getStockLevels() public méthode

Returns all stock entries.
public getStockLevels ( ) : ArrayCollection
Résultat Doctrine\Common\Collections\ArrayCollection

getStorageLocation() public méthode

Returns the storage location for this part.
public getStorageLocation ( ) : StorageLocation
Résultat PartKeepr\StorageLocationBundle\Entity\StorageLocation $storageLocation The storage location

hasRemovals() public méthode

public hasRemovals ( ) : mixed
Résultat mixed

isLowStock() public méthode

public isLowStock ( ) : boolean
Résultat boolean

onPrePersist() public méthode

Checks if the requirements for database persisting are given.
public onPrePersist ( )

onPreUpdate() public méthode

For a list of exceptions, see
public onPreUpdate ( )

recomputeStockLevels() public méthode

removeAttachment() public méthode

Removes a Part Attachment.
public removeAttachment ( PartAttachment $partAttachment )
$partAttachment PartAttachment An attachment to remove

removeDistributor() public méthode

Removes a part distributor.
public removeDistributor ( PartDistributor $partDistributor )
$partDistributor PartDistributor A part distributor to remove

removeManufacturer() public méthode

Removes a part manufacturer.
public removeManufacturer ( PartManufacturer $partManufacturer )
$partManufacturer PartManufacturer A part manufacturer to remove

removeStockLevel() public méthode

Removes a stock entry from this part.
public removeStockLevel ( StockEntry $stockEntry )
$stockEntry PartKeepr\StockBundle\Entity\StockEntry

setAveragePrice() public méthode

Sets the average price for this part.
public setAveragePrice ( float $price )
$price float The price to set

setCategory() public méthode

Sets the category for this part.
public setCategory ( PartCategory $category )
$category PartCategory The category

setComment() public méthode

Sets the comment for this part.
public setComment ( string $comment )
$comment string The comment for this part

setDescription() public méthode

Sets the description for this part.
public setDescription ( string $description )
$description string The part's short description

setFootprint() public méthode

Sets the footprint for this part.
public setFootprint ( Footprint $footprint = null )
$footprint PartKeepr\FootprintBundle\Entity\Footprint The footprint to set

setInternalPartNumber() public méthode

Sets the internal part number for this part.
public setInternalPartNumber ( string $partNumber )
$partNumber string

setLowStock() public méthode

public setLowStock ( boolean $lowStock )
$lowStock boolean

setMinStockLevel() public méthode

Only positive values are allowed.
public setMinStockLevel ( integer $minStockLevel )
$minStockLevel integer A minimum stock level, only values >= 0 are allowed.

setName() public méthode

Sets the name for this part.
public setName ( string $name )
$name string The part's name

setNeedsReview() public méthode

Sets the review flag.
public setNeedsReview ( boolean $bReview )
$bReview boolean True if the part needs review, false otherwise

setPartCondition() public méthode

Sets the condition for this part.
public setPartCondition ( string $partCondition )
$partCondition string The part's condition

setPartUnit() public méthode

Sets the part unit.
public setPartUnit ( PartMeasurementUnit $partUnit )
$partUnit PartMeasurementUnit The part unit object to set

setRemovals() public méthode

public setRemovals ( mixed $removals = false )
$removals mixed

setStatus() public méthode

Sets the status for this part. A status is any string describing the status, e.g. "new", "used", "broken" etc.
public setStatus ( string $status )
$status string The status

setStockLevel() public méthode

Sets the stock level.
public setStockLevel ( $stockLevel )
$stockLevel int The stock level to set

setStorageLocation() public méthode

Sets the storage location for this part.
public setStorageLocation ( StorageLocation $storageLocation )
$storageLocation PartKeepr\StorageLocationBundle\Entity\StorageLocation The storage location