mirror of
https://github.com/Karaka-Management/oms-HumanResourceManagement.git
synced 2026-02-15 04:18:39 +00:00
test fixes and changes for release
This commit is contained in:
parent
1065a93a80
commit
9b48cd3a87
|
|
@ -8,7 +8,7 @@
|
||||||
"uri": null,
|
"uri": null,
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": "fa fa-user",
|
"icon": "fa fa-user",
|
||||||
"order": 90,
|
"order": 60,
|
||||||
"from": "HumanResourceManagement",
|
"from": "HumanResourceManagement",
|
||||||
"permission": { "permission": 2, "category": null, "element": null },
|
"permission": { "permission": 2, "category": null, "element": null },
|
||||||
"parent": 0,
|
"parent": 0,
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,59 @@ class Employee implements \JsonSerializable
|
||||||
return \hash_equals($this->semiPrivateHash, $hash);
|
return \hash_equals($this->semiPrivateHash, $hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get files
|
||||||
|
*
|
||||||
|
* @return Media[]
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getFiles() : array
|
||||||
|
{
|
||||||
|
return $this->files;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get media file by type
|
||||||
|
*
|
||||||
|
* @param null|int $type Media type
|
||||||
|
*
|
||||||
|
* @return Media
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getFileByType(int $type = null) : Media
|
||||||
|
{
|
||||||
|
foreach ($this->files as $file) {
|
||||||
|
if ($file->type === $type) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new NullMedia();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all media files by type
|
||||||
|
*
|
||||||
|
* @param null|int $type Media type
|
||||||
|
*
|
||||||
|
* @return Media[]
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getFilesByType(int $type = null) : array
|
||||||
|
{
|
||||||
|
$files = [];
|
||||||
|
foreach ($this->files as $file) {
|
||||||
|
if ($file->type === $type) {
|
||||||
|
$files[] = $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $files;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get employee company history.
|
* Get employee company history.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ namespace Modules\HumanResourceManagement\Models;
|
||||||
|
|
||||||
use Modules\Admin\Models\Address;
|
use Modules\Admin\Models\Address;
|
||||||
use Modules\Media\Models\Media;
|
use Modules\Media\Models\Media;
|
||||||
|
use Modules\Media\Models\NullMedia;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Employee class.
|
* Employee class.
|
||||||
|
|
@ -101,6 +102,59 @@ class EmployeeEducationHistory implements \JsonSerializable
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get files
|
||||||
|
*
|
||||||
|
* @return Media[]
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getFiles() : array
|
||||||
|
{
|
||||||
|
return $this->files;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get media file by type
|
||||||
|
*
|
||||||
|
* @param null|int $type Media type
|
||||||
|
*
|
||||||
|
* @return Media
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getFileByType(int $type = null) : Media
|
||||||
|
{
|
||||||
|
foreach ($this->files as $file) {
|
||||||
|
if ($file->type === $type) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new NullMedia();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all media files by type
|
||||||
|
*
|
||||||
|
* @param null|int $type Media type
|
||||||
|
*
|
||||||
|
* @return Media[]
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getFilesByType(int $type = null) : array
|
||||||
|
{
|
||||||
|
$files = [];
|
||||||
|
foreach ($this->files as $file) {
|
||||||
|
if ($file->type === $type) {
|
||||||
|
$files[] = $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $files;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ declare(strict_types=1);
|
||||||
namespace Modules\HumanResourceManagement\Models;
|
namespace Modules\HumanResourceManagement\Models;
|
||||||
|
|
||||||
use Modules\Media\Models\Media;
|
use Modules\Media\Models\Media;
|
||||||
|
use Modules\Media\Models\NullMedia;
|
||||||
use Modules\Organization\Models\Department;
|
use Modules\Organization\Models\Department;
|
||||||
use Modules\Organization\Models\NullDepartment;
|
use Modules\Organization\Models\NullDepartment;
|
||||||
use Modules\Organization\Models\NullPosition;
|
use Modules\Organization\Models\NullPosition;
|
||||||
|
|
@ -124,6 +125,59 @@ class EmployeeHistory implements \JsonSerializable
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get files
|
||||||
|
*
|
||||||
|
* @return Media[]
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getFiles() : array
|
||||||
|
{
|
||||||
|
return $this->files;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get media file by type
|
||||||
|
*
|
||||||
|
* @param null|int $type Media type
|
||||||
|
*
|
||||||
|
* @return Media
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getFileByType(int $type = null) : Media
|
||||||
|
{
|
||||||
|
foreach ($this->files as $file) {
|
||||||
|
if ($file->type === $type) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new NullMedia();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all media files by type
|
||||||
|
*
|
||||||
|
* @param null|int $type Media type
|
||||||
|
*
|
||||||
|
* @return Media[]
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getFilesByType(int $type = null) : array
|
||||||
|
{
|
||||||
|
$files = [];
|
||||||
|
foreach ($this->files as $file) {
|
||||||
|
if ($file->type === $type) {
|
||||||
|
$files[] = $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $files;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ namespace Modules\HumanResourceManagement\Models;
|
||||||
|
|
||||||
use Modules\Admin\Models\Address;
|
use Modules\Admin\Models\Address;
|
||||||
use Modules\Media\Models\Media;
|
use Modules\Media\Models\Media;
|
||||||
|
use Modules\Media\Models\NullMedia;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Employee class.
|
* Employee class.
|
||||||
|
|
@ -97,6 +98,59 @@ class EmployeeWorkHistory implements \JsonSerializable
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get files
|
||||||
|
*
|
||||||
|
* @return Media[]
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getFiles() : array
|
||||||
|
{
|
||||||
|
return $this->files;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get media file by type
|
||||||
|
*
|
||||||
|
* @param null|int $type Media type
|
||||||
|
*
|
||||||
|
* @return Media
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getFileByType(int $type = null) : Media
|
||||||
|
{
|
||||||
|
foreach ($this->files as $file) {
|
||||||
|
if ($file->type === $type) {
|
||||||
|
return $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new NullMedia();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all media files by type
|
||||||
|
*
|
||||||
|
* @param null|int $type Media type
|
||||||
|
*
|
||||||
|
* @return Media[]
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public function getFilesByType(int $type = null) : array
|
||||||
|
{
|
||||||
|
$files = [];
|
||||||
|
foreach ($this->files as $file) {
|
||||||
|
if ($file->type === $type) {
|
||||||
|
$files[] = $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $files;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -257,6 +257,25 @@ $CONFIG = [
|
||||||
'root' => '/',
|
'root' => '/',
|
||||||
'https' => false,
|
'https' => false,
|
||||||
],
|
],
|
||||||
|
'app' => [
|
||||||
|
'path' => __DIR__,
|
||||||
|
'default' => [
|
||||||
|
'app' => 'Backend',
|
||||||
|
'id' => 'backend',
|
||||||
|
'lang' => 'en',
|
||||||
|
'theme' => 'Backend',
|
||||||
|
'org' => 1,
|
||||||
|
],
|
||||||
|
'domains' => [
|
||||||
|
'127.0.0.1' => [
|
||||||
|
'app' => 'Backend',
|
||||||
|
'id' => 'backend',
|
||||||
|
'lang' => 'en',
|
||||||
|
'theme' => 'Backend',
|
||||||
|
'org' => 1,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
'socket' => [
|
'socket' => [
|
||||||
'master' => [
|
'master' => [
|
||||||
'host' => '127.0.0.1',
|
'host' => '127.0.0.1',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user