mirror of
https://github.com/Karaka-Management/oms-ClientManagement.git
synced 2026-01-18 10:48:40 +00:00
PhpUnit fixes
This commit is contained in:
parent
1bb6695fa1
commit
be2ff1cd27
|
|
@ -50,11 +50,11 @@ class Installer extends InstallerAbstract
|
|||
'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'clientmgmt_client` (
|
||||
`clientmgmt_client_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`clientmgmt_client_no` int(11) NOT NULL,
|
||||
`clientmgmt_client_no_reverse` int(11) NOT NULL,
|
||||
`clientmgmt_client_no_reverse` varchar(25) DEFAULT NULL,
|
||||
`clientmgmt_client_status` tinyint(2) NOT NULL,
|
||||
`clientmgmt_client_type` tinyint(2) NOT NULL,
|
||||
`clientmgmt_client_taxid` varchar(50) NOT NULL,
|
||||
`clientmgmt_client_info` text NOT NULL,
|
||||
`clientmgmt_client_taxid` varchar(50) DEFAULT NULL,
|
||||
`clientmgmt_client_info` text DEFAULT NULL,
|
||||
`clientmgmt_client_created_at` datetime NOT NULL,
|
||||
`clientmgmt_client_account` int(11) NOT NULL,
|
||||
PRIMARY KEY (`clientmgmt_client_id`),
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ class Client
|
|||
|
||||
public function setInfo(string $info) /* : void */
|
||||
{
|
||||
return $this->info;
|
||||
$this->info = $info;
|
||||
}
|
||||
|
||||
public function getCreatedAt() : \DateTime
|
||||
|
|
@ -136,14 +136,14 @@ class Client
|
|||
return $this->createdAt;
|
||||
}
|
||||
|
||||
public function getProfile() : Account
|
||||
public function getProfile() : Profile
|
||||
{
|
||||
return $this->profile;
|
||||
}
|
||||
|
||||
public function setProfile(Account $account) /* : void */
|
||||
public function setProfile(Profile $profile) /* : void */
|
||||
{
|
||||
$this->profile = $account;
|
||||
$this->profile = $profile;
|
||||
}
|
||||
|
||||
public function getFiles() : array
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class ClientMapper extends DataMapperAbstract
|
|||
'clientmgmt_client_type' => ['name' => 'clientmgmt_client_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'clientmgmt_client_taxid' => ['name' => 'clientmgmt_client_taxid', 'type' => 'string', 'internal' => 'taxId'],
|
||||
'clientmgmt_client_info' => ['name' => 'clientmgmt_client_info', 'type' => 'string', 'internal' => 'info'],
|
||||
'clientmgmt_client_at' => ['name' => 'clientmgmt_client_at', 'type' => 'DateTime', 'internal' => 'createdAt'],
|
||||
'clientmgmt_client_created_at' => ['name' => 'clientmgmt_client_created_at', 'type' => 'DateTime', 'internal' => 'createdAt'],
|
||||
'clientmgmt_client_account' => ['name' => 'clientmgmt_client_account', 'type' => 'int', 'internal' => 'profile'],
|
||||
];
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ class ClientMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static $createdAt = 'clientmgmt_client_at';
|
||||
protected static $createdAt = 'clientmgmt_client_created_at';
|
||||
|
||||
/**
|
||||
* Has one relation.
|
||||
|
|
@ -90,7 +90,7 @@ class ClientMapper extends DataMapperAbstract
|
|||
'dst' => 'clientmgmt_client_media_dst',
|
||||
'src' => 'clientmgmt_client_media_src',
|
||||
],
|
||||
'contact' => [
|
||||
'contactElements' => [
|
||||
'mapper' => ContactElementMapper::class,
|
||||
'table' => 'clientmgmt_client_contactelement',
|
||||
'dst' => 'clientmgmt_client_contactelement_dst',
|
||||
|
|
@ -113,6 +113,11 @@ class ClientMapper extends DataMapperAbstract
|
|||
{
|
||||
try {
|
||||
$objId = parent::create($obj, $relations);
|
||||
|
||||
if($objId === null || !is_scalar($objId)) {
|
||||
return $objId;
|
||||
}
|
||||
|
||||
$query = new Builder(self::$db);
|
||||
|
||||
$query->prefix(self::$db->getPrefix())
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user