mirror of
https://github.com/Karaka-Management/oms-SupplierManagement.git
synced 2026-02-16 16:48:39 +00:00
bug fixes and subscription improvements
This commit is contained in:
parent
66f0ea48cc
commit
a7bf9066ab
|
|
@ -57,29 +57,13 @@ class Supplier
|
||||||
public Account $account;
|
public Account $account;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attributes.
|
* Notes.
|
||||||
*
|
|
||||||
* @var \Modules\Attribute\Models\Attribute[]
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
private array $attributes = [];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Files.
|
|
||||||
*
|
*
|
||||||
* @var EditorDoc[]
|
* @var EditorDoc[]
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private array $notes = [];
|
private array $notes = [];
|
||||||
|
|
||||||
/**
|
|
||||||
* Files.
|
|
||||||
*
|
|
||||||
* @var Media[]
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
private array $files = [];
|
|
||||||
|
|
||||||
private array $contactElements = [];
|
private array $contactElements = [];
|
||||||
|
|
||||||
private array $address = [];
|
private array $address = [];
|
||||||
|
|
@ -240,20 +224,6 @@ class Supplier
|
||||||
return $this->notes;
|
return $this->notes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Add media.
|
|
||||||
*
|
|
||||||
* @param Media $file Media
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function addFile(Media $file) : void
|
|
||||||
{
|
|
||||||
$this->files[] = $file;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get addresses.
|
* Get addresses.
|
||||||
*
|
*
|
||||||
|
|
@ -355,58 +325,6 @@ class Supplier
|
||||||
$this->contactElements[] = $element;
|
$this->contactElements[] = $element;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get files
|
|
||||||
*
|
|
||||||
* @return Media[]
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getFiles() : array
|
|
||||||
{
|
|
||||||
return $this->files;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get media file by type
|
|
||||||
*
|
|
||||||
* @param int $type Media type
|
|
||||||
*
|
|
||||||
* @return Media
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getFileByType(int $type) : Media
|
|
||||||
{
|
|
||||||
foreach ($this->files as $file) {
|
|
||||||
if ($file->hasMediaTypeId($type)) {
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new NullMedia();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get all media files by type name
|
|
||||||
*
|
|
||||||
* @param string $type Media type
|
|
||||||
*
|
|
||||||
* @return Media
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getFileByTypeName(string $type) : Media
|
|
||||||
{
|
|
||||||
foreach ($this->files as $file) {
|
|
||||||
if ($file->hasMediaTypeName($type)) {
|
|
||||||
return $file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new NullMedia();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
@ -430,5 +348,6 @@ class Supplier
|
||||||
return $this->toArray();
|
return $this->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
use \Modules\Media\Models\MediaListTrait;
|
||||||
use \Modules\Attribute\Models\AttributeHolderTrait;
|
use \Modules\Attribute\Models\AttributeHolderTrait;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||||
* @link https://jingga.app
|
* @link https://jingga.app
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*
|
*
|
||||||
* @template T of BaseStringL11n
|
* @template T of SupplierL11n
|
||||||
* @extends DataMapperFactory<T>
|
* @extends DataMapperFactory<T>
|
||||||
*/
|
*/
|
||||||
final class SupplierL11nMapper extends DataMapperFactory
|
final class SupplierL11nMapper extends DataMapperFactory
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user