-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added indexes to Model. Now, you can control it!
- Loading branch information
1 parent
07d82d2
commit dcccbce
Showing
3 changed files
with
141 additions
and
9 deletions.
There are no files selected for viewing
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,97 @@ | ||
<?php | ||
/** | ||
* | ||
* | ||
* All rights reserved. | ||
* | ||
* @author Okulov Anton | ||
* @email [email protected] | ||
* @version 1.0 | ||
* @date 08/02/2020 11:39 | ||
*/ | ||
|
||
namespace Phact\Orm; | ||
|
||
|
||
class Index | ||
{ | ||
private $indexName; | ||
/** | ||
* @var array | ||
*/ | ||
private $columns; | ||
/** | ||
* @var bool | ||
*/ | ||
private $isUnique; | ||
/** | ||
* @var bool | ||
*/ | ||
private $isPrimary; | ||
/** | ||
* @var array | ||
*/ | ||
private $flags; | ||
/** | ||
* @var array | ||
*/ | ||
private $options; | ||
|
||
public function __construct($indexName, array $columns, $isUnique = false, $isPrimary = false, array $flags = [], array $options = []) | ||
{ | ||
$this->indexName = $indexName; | ||
$this->columns = $columns; | ||
$this->isUnique = $isUnique; | ||
$this->isPrimary = $isPrimary; | ||
$this->flags = $flags; | ||
$this->options = $options; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getIndexName() | ||
{ | ||
return $this->indexName; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getColumns(): array | ||
{ | ||
return $this->columns; | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isUnique(): bool | ||
{ | ||
return $this->isUnique; | ||
} | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function isPrimary(): bool | ||
{ | ||
return $this->isPrimary; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getFlags(): array | ||
{ | ||
return $this->flags; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function getOptions(): array | ||
{ | ||
return $this->options; | ||
} | ||
} |
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
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