Skip to content

Commit

Permalink
feat(tenant): Added multi domain tenant entities
Browse files Browse the repository at this point in the history
  • Loading branch information
pavlovicnemanja committed Jun 4, 2024
1 parent ea95a11 commit 64f0de8
Show file tree
Hide file tree
Showing 6 changed files with 167 additions and 0 deletions.
Binary file added src/SWP/Bundle/.DS_Store
Binary file not shown.
Binary file added src/SWP/Bundle/CoreBundle/.DS_Store
Binary file not shown.
Binary file added src/SWP/Bundle/CoreBundle/Migrations/.DS_Store
Binary file not shown.
Binary file not shown.
105 changes: 105 additions & 0 deletions src/SWP/Component/MultiTenancy/Model/TenantDomain.php
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 src/SWP/Component/MultiTenancy/Model/TenantDomainInterface.php
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);
}

0 comments on commit 64f0de8

Please sign in to comment.