mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-22 01:49:05 +02:00
Added a basic form to perform builds.
Logic does not work yet.
This commit is contained in:
parent
3dc9376f40
commit
83d734747a
6 changed files with 292 additions and 5 deletions
|
@ -74,12 +74,24 @@ class ProjectBuildHelper
|
|||
* Checks if the given project can be build with the current stock.
|
||||
* This means that the maximum buildable count is greater or equal than the requested $number_of_projects
|
||||
* @param Project $project
|
||||
* @parm int $number_of_projects
|
||||
* @parm int $number_of_builds
|
||||
* @return bool
|
||||
*/
|
||||
public function isProjectBuildable(Project $project, int $number_of_projects = 1): bool
|
||||
public function isProjectBuildable(Project $project, int $number_of_builds = 1): bool
|
||||
{
|
||||
return $this->getMaximumBuildableCount($project) >= $number_of_projects;
|
||||
return $this->getMaximumBuildableCount($project) >= $number_of_builds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the given BOM entry can be build with the current stock.
|
||||
* This means that the maximum buildable count is greater or equal than the requested $number_of_projects
|
||||
* @param ProjectBOMEntry $bom_entry
|
||||
* @param int $number_of_builds
|
||||
* @return bool
|
||||
*/
|
||||
public function isBOMEntryBuildable(ProjectBOMEntry $bom_entry, int $number_of_builds = 1): bool
|
||||
{
|
||||
return $this->getMaximumBuildableCountForBOMEntry($bom_entry) >= $number_of_builds;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue