Skip to content

Commit 2504e2c

Browse files
committed
Add the interface for all entities
1 parent ac8ba8d commit 2504e2c

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

src/LightQL/Entities/IEntity.php

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
3+
/**
4+
* LightQL - The lightweight PHP ORM
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
* SOFTWARE.
23+
*
24+
* @category Library
25+
* @package LightQL
26+
* @author Axel Nana <ax.lnana@outlook.com>
27+
* @copyright 2018 Aliens Group, Inc.
28+
* @license MIT <https://github.com/ElementaryFramework/LightQL/blob/master/LICENSE>
29+
* @version GIT: 0.0.1
30+
* @link http://lightql.na2axl.tk
31+
*/
32+
33+
namespace ElementaryFramework\LightQL\Entities;
34+
35+
/**
36+
* IEntity
37+
*
38+
* Provides default methods for all entities.
39+
*
40+
* @abstract
41+
* @category Interfaces
42+
* @package LightQL
43+
* @author Nana Axel <ax.lnana@outlook.com>
44+
* @link http://lightql.na2axl.tk/docs/api/LightQL/Entities/IDatabaseEntity
45+
*/
46+
interface IEntity
47+
{
48+
49+
/**
50+
* Populates data in the entity.
51+
*
52+
* @param array $data The raw database data.
53+
*/
54+
function hydrate(array $data);
55+
56+
/**
57+
* Gets the raw value of a table column.
58+
*
59+
* @param string $column The table column name.
60+
*
61+
* @return mixed
62+
*/
63+
function get(string $column);
64+
65+
/**
66+
* Sets the raw value of a table column.
67+
*
68+
* @param string $column The table column name.
69+
* @param mixed $value The table column value.
70+
*/
71+
function set(string $column, $value);
72+
73+
}

0 commit comments

Comments
 (0)