-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tenant): Added multi domain tenant entities
- Loading branch information
1 parent
ea95a11
commit 64f0de8
Showing
6 changed files
with
167 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Superdesk Web Publisher MultiTenancy Component. | ||
* | ||
* Copyright 2015 Sourcefabric z.u. and contributors. | ||
* | ||
* For the full copyright and license information, please see the | ||
* AUTHORS and LICENSE files distributed with this source code. | ||
* | ||
* @copyright 2015 Sourcefabric z.ú | ||
* @license http://www.superdesk.org/license | ||
*/ | ||
|
||
namespace SWP\Component\MultiTenancy\Model; | ||
|
||
use SWP\Component\Common\Model\EnableableTrait; | ||
use SWP\Component\Common\Model\SoftDeletableTrait; | ||
use SWP\Component\Common\Model\TimestampableTrait; | ||
|
||
class TenantDomain implements TenantDomainInterface | ||
{ | ||
use SoftDeletableTrait; | ||
use TimestampableTrait; | ||
use EnableableTrait; | ||
|
||
/** | ||
* @var mixed | ||
*/ | ||
protected $id; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $subdomain; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $domainName; | ||
|
||
/** | ||
* Tenant constructor. | ||
*/ | ||
public function __construct() | ||
{ | ||
$this->createdAt = new \DateTime(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function setId($id) | ||
{ | ||
$this->id = $id; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getSubdomain() | ||
{ | ||
return $this->subdomain; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function setSubdomain($subdomain) | ||
{ | ||
$this->subdomain = $subdomain; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getDomainName() | ||
{ | ||
return $this->domainName; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function setDomainName($domainName) | ||
{ | ||
$this->domainName = $domainName; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function __toString() | ||
{ | ||
return (string) $this->subdomain; | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
src/SWP/Component/MultiTenancy/Model/TenantDomainInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Superdesk Web Publisher MultiTenancy Component. | ||
* | ||
* Copyright 2015 Sourcefabric z.u. and contributors. | ||
* | ||
* For the full copyright and license information, please see the | ||
* AUTHORS and LICENSE files distributed with this source code. | ||
* | ||
* @copyright 2015 Sourcefabric z.ú | ||
* @license http://www.superdesk.org/license | ||
*/ | ||
|
||
namespace SWP\Component\MultiTenancy\Model; | ||
|
||
use SWP\Bundle\SettingsBundle\Model\SettingsOwnerInterface; | ||
use SWP\Component\Common\Model\EnableableInterface; | ||
use SWP\Component\Common\Model\SoftDeletableInterface; | ||
use SWP\Component\Common\Model\TimestampableInterface; | ||
use SWP\Component\Storage\Model\PersistableInterface; | ||
|
||
interface TenantDomainInterface extends TimestampableInterface, EnableableInterface, SoftDeletableInterface, PersistableInterface, SettingsOwnerInterface | ||
{ | ||
/** | ||
* Gets the tenant identifier. | ||
* | ||
* @return mixed The tenant identifier | ||
*/ | ||
public function getId(); | ||
|
||
/** | ||
* Sets the tenant identifier. | ||
* | ||
* @param mixed $id The tenant identifier | ||
*/ | ||
public function setId($id); | ||
|
||
/** | ||
* Gets the tenant subdomain. | ||
* | ||
* @return string The tenant subdomain | ||
*/ | ||
public function getSubdomain(); | ||
|
||
/** | ||
* Sets the tenant identifier. | ||
* | ||
* @param string $subdomain The tenant subdomain | ||
*/ | ||
public function setSubdomain($subdomain); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getDomainName(); | ||
|
||
/** | ||
* @param string $domainName | ||
*/ | ||
public function setDomainName($domainName); | ||
} |