PHP Class PartKeepr\PartBundle\Entity\Part

Inheritance: extends PartKeepr\CoreBundle\Entity\BaseEntity
ファイルを表示 Open project: partkeepr/PartKeepr Class Usage Examples

Public Methods

Method 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

Method 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 method

public __construct ( )

addAttachment() public method

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

addDistributor() public method

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

addManufacturer() public method

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

addStockLevel() public method

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

executeSaveListener() public method

public executeSaveListener ( )

getAttachments() public method

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

getAveragePrice() public method

Returns the acrage price.
public getAveragePrice ( ) : float
return float

getCategory() public method

Returns the assigned category.
public getCategory ( ) : PartCategory
return PartCategory

getCategoryPath() public method

Returns the category path.
public getCategoryPath ( ) : string
return string

getComment() public method

Returns the comment for this part.
public getComment ( ) : string
return string The comment

getCreateDate() public method

Returns the create date.
public getCreateDate ( ) : DateTime
return DateTime The create date+time

getDescription() public method

Returns the short description of this part.
public getDescription ( ) : string
return string The part description

getDistributors() public method

Returns the distributors array.
public getDistributors ( ) : ArrayCollection
return Doctrine\Common\Collections\ArrayCollection the distributors

getFootprint() public method

Retrieves the footprint.
public getFootprint ( )

getInternalPartNumber() public method

Returns the internal part number for this part.
public getInternalPartNumber ( ) : string
return string the internal part number

getManufacturers() public method

Returns the manufacturers array.
public getManufacturers ( ) : ArrayCollection
return Doctrine\Common\Collections\ArrayCollection the manufacturers

getMinStockLevel() public method

Returns the minimum stock level.
public getMinStockLevel ( ) : integer
return integer

getName() public method

Returns the name of this part.
public getName ( ) : string
return string The part name

getNeedsReview() public method

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

getParameters() public method

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

getPartCondition() public method

Returns the condition of this part.
public getPartCondition ( ) : string
return string The part condition

getPartUnit() public method

Returns the part unit.
public getPartUnit ( ) : PartMeasurementUnit
return PartMeasurementUnit The part unit object

getProjectNames() public method

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

getProjectParts() public method

Returns the project parts.
public getProjectParts ( ) : ArrayCollection
return Doctrine\Common\Collections\ArrayCollection

getStatus() public method

Returns the status for this part.
public getStatus ( ) : string
return string The status

getStockLevel() public method

Returns the stock level.
public getStockLevel ( ) : integer
return integer The stock level

getStockLevels() public method

Returns all stock entries.
public getStockLevels ( ) : ArrayCollection
return Doctrine\Common\Collections\ArrayCollection

getStorageLocation() public method

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

hasRemovals() public method

public hasRemovals ( ) : mixed
return mixed

isLowStock() public method

public isLowStock ( ) : boolean
return boolean

onPrePersist() public method

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

onPreUpdate() public method

For a list of exceptions, see
public onPreUpdate ( )

recomputeStockLevels() public method

removeAttachment() public method

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

removeDistributor() public method

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

removeManufacturer() public method

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

removeStockLevel() public method

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

setAveragePrice() public method

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

setCategory() public method

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

setComment() public method

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

setDescription() public method

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

setFootprint() public method

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

setInternalPartNumber() public method

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

setLowStock() public method

public setLowStock ( boolean $lowStock )
$lowStock boolean

setMinStockLevel() public method

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

setName() public method

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

setNeedsReview() public method

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

setPartCondition() public method

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

setPartUnit() public method

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

setRemovals() public method

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

setStatus() public method

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 method

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

setStorageLocation() public method

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