Skip to content

Commit

Permalink
3.1.3
Browse files Browse the repository at this point in the history
Numeric Type
  • Loading branch information
Nurlan Mukhanov committed Sep 8, 2024
1 parent 2c6f2bd commit 132f013
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "falseclock/dbd-php-entity",
"type": "library",
"version": "3.1.2",
"version": "3.1.3",
"description": "DTO like library to fetch any data in an Object-Oriented manner (ORM)",
"keywords": [
"dbd",
Expand Down
2 changes: 1 addition & 1 deletion src/DBD/Entity/Columns/BigIntColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/********************************************************************************
* Apache License, Version 2.0 *
* *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
Expand Down
2 changes: 1 addition & 1 deletion src/DBD/Entity/Columns/IntColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/********************************************************************************
* Apache License, Version 2.0 *
* *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
Expand Down
2 changes: 1 addition & 1 deletion src/DBD/Entity/Columns/JsonColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/********************************************************************************
* Apache License, Version 2.0 *
* *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
Expand Down
2 changes: 1 addition & 1 deletion src/DBD/Entity/Columns/JsonbColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/********************************************************************************
* Apache License, Version 2.0 *
* *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
Expand Down
61 changes: 61 additions & 0 deletions src/DBD/Entity/Columns/NumericColumn.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php
/********************************************************************************
* Apache License, Version 2.0 *
* *
* Copyright [2024] [Nurlan Mukhanov <[email protected]>] *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
********************************************************************************/

declare(strict_types=1);

namespace DBD\Entity\Columns;

use Attribute;
use DBD\Entity\Column;
use DBD\Entity\Primitives\NumericPrimitives;

/**
* Class NumericColumn
*
* @package DBD\Entity\Columns
*/
#[Attribute(Attribute::TARGET_PROPERTY)]
class NumericColumn extends Column
{
public function __construct(
string $name,
int $length,
int $precision,
?string $annotation = null,
bool $nullable = true,
float $defaultValue = null,
bool $auto = false,
bool $primary = false
)
{
parent::__construct([
Column::NAME => $name,
Column::MAXLENGTH => $length,
Column::PRECISION => $precision,
Column::PRIMITIVE_TYPE => NumericPrimitives::Decimal,
Column::ORIGIN_TYPE => 'numeric',
Column::IS_AUTO => $auto,
Column::NULLABLE => $nullable,
Column::KEY => $primary,
Column::DEFAULT => $defaultValue,
Column::ANNOTATION => $annotation
]);
}
}
2 changes: 1 addition & 1 deletion src/DBD/Entity/Columns/ShortIntColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/********************************************************************************
* Apache License, Version 2.0 *
* *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
Expand Down
2 changes: 1 addition & 1 deletion src/DBD/Entity/Columns/StringColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/********************************************************************************
* Apache License, Version 2.0 *
* *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
Expand Down
2 changes: 1 addition & 1 deletion src/DBD/Entity/Columns/TextColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/********************************************************************************
* Apache License, Version 2.0 *
* *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
Expand Down
2 changes: 1 addition & 1 deletion src/DBD/Entity/Columns/TimeColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/********************************************************************************
* Apache License, Version 2.0 *
* *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
Expand Down
2 changes: 1 addition & 1 deletion src/DBD/Entity/Columns/TimeStampColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/********************************************************************************
* Apache License, Version 2.0 *
* *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
Expand Down
2 changes: 1 addition & 1 deletion src/DBD/Entity/Columns/TimeStampTZColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/********************************************************************************
* Apache License, Version 2.0 *
* *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* Copyright [2024] [Nick Ispandiarov <[email protected]>] *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
Expand Down

0 comments on commit 132f013

Please sign in to comment.