forked from mirror/Part-DB.Part-DB-server
Started work on a build project tool.
This commit is contained in:
parent
fcd8d205d3
commit
3dc9376f40
5 changed files with 76 additions and 10 deletions
|
@ -72,13 +72,14 @@ class ProjectBuildHelper
|
|||
|
||||
/**
|
||||
* Checks if the given project can be build with the current stock.
|
||||
* This means that the maximum buildable count is greater than 0.
|
||||
* 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
|
||||
* @return bool
|
||||
*/
|
||||
public function isProjectBuildable(Project $project): bool
|
||||
public function isProjectBuildable(Project $project, int $number_of_projects = 1): bool
|
||||
{
|
||||
return $this->getMaximumBuildableCount($project) > 0;
|
||||
return $this->getMaximumBuildableCount($project) >= $number_of_projects;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue