mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-08 01:14:34 +02:00
Fixed coding style.
This commit is contained in:
parent
24939f2342
commit
fd61c8d9e2
129 changed files with 962 additions and 1091 deletions
|
@ -173,7 +173,7 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
|
|||
/**
|
||||
* Set the addres.
|
||||
*
|
||||
* @param string $new_address the new address (with "\n" as line break)
|
||||
* @param string $new_address the new address (with "\n" as line break)
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
|
@ -188,6 +188,7 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
|
|||
* Set the phone number.
|
||||
*
|
||||
* @param string $new_phone_number the new phone number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setPhoneNumber(string $new_phone_number): self
|
||||
|
@ -201,6 +202,7 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
|
|||
* Set the fax number.
|
||||
*
|
||||
* @param string $new_fax_number the new fax number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFaxNumber(string $new_fax_number): self
|
||||
|
@ -214,6 +216,7 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
|
|||
* Set the e-mail address.
|
||||
*
|
||||
* @param string $new_email_address the new e-mail address
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setEmailAddress(string $new_email_address): self
|
||||
|
@ -227,6 +230,7 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
|
|||
* Set the website.
|
||||
*
|
||||
* @param string $new_website the new website
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setWebsite(string $new_website): self
|
||||
|
@ -240,6 +244,7 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
|
|||
* Set the link to the website of an article.
|
||||
*
|
||||
* @param string $new_url the new URL with the placeholder %PARTNUMBER% for the part number
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setAutoProductUrl(string $new_url): self
|
||||
|
|
|
@ -57,6 +57,15 @@ abstract class AbstractNamedDBElement extends AbstractDBElement implements Named
|
|||
return $this->getName();
|
||||
}
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
if ($this->id) {
|
||||
//We create a new object, so give it a new creation date
|
||||
$this->addedDate = null;
|
||||
}
|
||||
parent::__clone(); // TODO: Change the autogenerated stub
|
||||
}
|
||||
|
||||
/********************************************************************************
|
||||
*
|
||||
* Getters
|
||||
|
@ -89,15 +98,7 @@ abstract class AbstractNamedDBElement extends AbstractDBElement implements Named
|
|||
public function setName(string $new_name): self
|
||||
{
|
||||
$this->name = $new_name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function __clone()
|
||||
{
|
||||
if ($this->id) {
|
||||
//We create a new object, so give it a new creation date
|
||||
$this->addedDate = null;
|
||||
}
|
||||
parent::__clone(); // TODO: Change the autogenerated stub
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement
|
|||
* Check if this element is a child of another element (recursive).
|
||||
*
|
||||
* @param AbstractStructuralDBElement $another_element the object to compare
|
||||
* IMPORTANT: both objects to compare must be from the same class (for example two "Device" objects)!
|
||||
* IMPORTANT: both objects to compare must be from the same class (for example two "Device" objects)!
|
||||
*
|
||||
* @return bool True, if this element is child of $another_element.
|
||||
*
|
||||
|
@ -316,13 +316,14 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement
|
|||
}
|
||||
|
||||
/**
|
||||
* @param static[]|Collection $elements
|
||||
* @param static[]|Collection $elements
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setChildren($elements): self
|
||||
{
|
||||
if (!is_array($elements) && !$elements instanceof Collection) {
|
||||
throw new InvalidArgumentException('$elements must be an array or Collection!');
|
||||
if (! is_array($elements) && ! $elements instanceof Collection) {
|
||||
throw new InvalidArgumentException('$elements must be an array or Collection!');
|
||||
}
|
||||
|
||||
$this->children = $elements;
|
||||
|
@ -331,7 +332,6 @@ abstract class AbstractStructuralDBElement extends AttachmentContainingDBElement
|
|||
}
|
||||
|
||||
/**
|
||||
* @param bool $not_selectable
|
||||
* @return AbstractStructuralDBElement
|
||||
*/
|
||||
public function setNotSelectable(bool $not_selectable): self
|
||||
|
|
|
@ -72,7 +72,6 @@ trait MasterAttachmentTrait
|
|||
/**
|
||||
* Sets the new master picture for this part.
|
||||
*
|
||||
* @param Attachment|null $new_master_attachment
|
||||
* @return $this
|
||||
*/
|
||||
public function setMasterPictureAttachment(?Attachment $new_master_attachment): self
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue