PHP Class PartKeepr\StockBundle\Entity\StockEntry

Inheritance: extends PartKeepr\CoreBundle\Entity\BaseEntity
显示文件 Open project: partkeepr/PartKeepr Class Usage Examples

Public Methods

Method Description
__construct ( ) Creates a new stock entry. A stock entry tracks how many parts were the stockLevel is the amount of items added/removed, by which user and how much the user paid for it (for adding parts only!).
checkPrice ( ) If the stock level is negative, we can't have a price.
getComment ( ) : string Returns the comment.
getCorrection ( ) : boolean Returns if the entry is a correction entry.
getDateTime ( ) : DateTime Returns the date+time when the record was created.
getPart ( ) : Part Returns the part assigned to this entry.
getPrice ( ) : float Returns the price for this entry. The price is for a single item only.
getStockLevel ( ) : integer Returns the stock level for this entry.
getUser ( ) : User Returns the user for this entry.
isRemoval ( ) : boolean Returns if the current stock entry is a removal.
setComment ( string $comment ) Sets a comment.
setCorrection ( $bCorrection ) Sets if the stock entry is a correction record.
setPart ( Part $part = null ) Sets the part assigned to this entry.
setPrice ( float $price ) Sets the price for the item stored.
setStockLevel ( integer $stockLevel ) Sets the stock level for this entry.
setUser ( User $user = null ) Sets the user assigned to this entry.

Private Methods

Method Description
setDateTime ( DateTime $dateTime ) Sets the date+time.

Method Details

__construct() public method

Creates a new stock entry. A stock entry tracks how many parts were the stockLevel is the amount of items added/removed, by which user and how much the user paid for it (for adding parts only!).
public __construct ( )

checkPrice() public method

If the stock level is negative, we can't have a price.
public checkPrice ( )

getComment() public method

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

getCorrection() public method

Returns if the entry is a correction entry.
public getCorrection ( ) : boolean
return boolean True if the entry is a correction entry, false otherwise

getDateTime() public method

Returns the date+time when the record was created.
public getDateTime ( ) : DateTime
return DateTime The date+time when the record was created

getPart() public method

Returns the part assigned to this entry.
public getPart ( ) : Part
return PartKeepr\PartBundle\Entity\Part $part The part

getPrice() public method

Returns the price for this entry. The price is for a single item only.
public getPrice ( ) : float
return float The price for this entry.

getStockLevel() public method

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

getUser() public method

Returns the user for this entry.
public getUser ( ) : User
return PartKeepr\AuthBundle\Entity\User the user

isRemoval() public method

Returns if the current stock entry is a removal.
public isRemoval ( ) : boolean
return boolean True if the entry is a removal, false otherwise

setComment() public method

Sets a comment.
public setComment ( string $comment )
$comment string

setCorrection() public method

Sets if the stock entry is a correction record.
public setCorrection ( $bCorrection )
$bCorrection boolean True if the record is a correction record, false otherwise

setPart() public method

Sets the part assigned to this entry.
public setPart ( Part $part = null )
$part PartKeepr\PartBundle\Entity\Part The part to set

setPrice() public method

Please note that the price is for a single item only, and can be null.
public setPrice ( float $price )
$price float The price to set

setStockLevel() public method

Negative values means part removal, positive values means part adding.
public setStockLevel ( integer $stockLevel )
$stockLevel integer The stock level

setUser() public method

Sets the user assigned to this entry.
public setUser ( User $user = null )
$user PartKeepr\AuthBundle\Entity\User The user The user to set