Skip to content

Commit f7e1794

Browse files
committed
2 parents 7174f0a + 2969f07 commit f7e1794

28 files changed

+3093
-198
lines changed

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
}
1414
],
1515
"require": {
16-
"php": "^7.1.10"
16+
"php": "^7.1.10",
17+
"elementaryframework/annotations": "^2.0.1"
1718
},
1819
"keywords": [
1920
"orm",
@@ -22,7 +23,7 @@
2223
],
2324
"autoload": {
2425
"psr-4": {
25-
"LightQL\\": "src/LightQL/"
26+
"ElementaryFramework\\LightQL\\": "src/LightQL/"
2627
}
2728
}
2829
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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 1.0.0
30+
* @link http://lightql.na2axl.tk
31+
*/
32+
33+
namespace ElementaryFramework\LightQL\Annotations;
34+
35+
use ElementaryFramework\Annotations\Annotation;
36+
37+
/**
38+
* Auto Increment Annotation
39+
*
40+
* Used to define that a property is an auto
41+
* incremented table column.
42+
*
43+
* @usage('property' => true, 'inherited' => true)
44+
*
45+
* @category Annotations
46+
* @package LightQL
47+
* @author Nana Axel <ax.lnana@outlook.com>
48+
* @link http://lightql.na2axl.tk/docs/api/LightQL/Annotations/AutoIncrementAnnotation
49+
*/
50+
class AutoIncrementAnnotation extends Annotation
51+
{
52+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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 1.0.0
30+
* @link http://lightql.na2axl.tk
31+
*/
32+
33+
namespace ElementaryFramework\LightQL\Annotations;
34+
35+
use ElementaryFramework\Annotations\Annotation;
36+
37+
/**
38+
* Column Annotation
39+
*
40+
* Used to define that a property is a table column.
41+
*
42+
* @usage('property' => true, 'inherited' => true)
43+
*
44+
* @category Annotations
45+
* @package LightQL
46+
* @author Nana Axel <ax.lnana@outlook.com>
47+
* @link http://lightql.na2axl.tk/docs/api/LightQL/Annotations/ColumnAnnotation
48+
*/
49+
class ColumnAnnotation extends Annotation
50+
{
51+
/**
52+
* The name of the column.
53+
*
54+
* @var string
55+
*/
56+
public $name;
57+
58+
/**
59+
* The type of the column.
60+
*
61+
* @var string
62+
*/
63+
public $type;
64+
65+
/**
66+
* The default value of the column.
67+
*
68+
* @var mixed
69+
*/
70+
public $default = null;
71+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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 1.0.0
30+
* @link http://lightql.na2axl.tk
31+
*/
32+
33+
namespace ElementaryFramework\LightQL\Annotations;
34+
35+
use ElementaryFramework\Annotations\Annotation;
36+
use ElementaryFramework\Annotations\Exceptions\AnnotationException;
37+
use ElementaryFramework\LightQL\Entities\Entity;
38+
39+
/**
40+
* Entity Annotation
41+
*
42+
* Used to define a class as an entity.
43+
*
44+
* @usage('class' => true, 'inherited' => true)
45+
*
46+
* @category Annotations
47+
* @package LightQL
48+
* @author Nana Axel <ax.lnana@outlook.com>
49+
* @link http://lightql.na2axl.tk/docs/api/LightQL/Annotations/EntityAnnotation
50+
*/
51+
class EntityAnnotation extends Annotation
52+
{
53+
/**
54+
* The table name represented by the entity.
55+
*
56+
* @var string
57+
*/
58+
public $table;
59+
60+
/**
61+
* The fetch mode used by the entity.
62+
*
63+
* @var integer
64+
*/
65+
public $fetchMode = Entity::FETCH_LAZY;
66+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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 1.0.0
30+
* @link http://lightql.na2axl.tk
31+
*/
32+
33+
namespace ElementaryFramework\LightQL\Annotations;
34+
35+
use ElementaryFramework\Annotations\Annotation;
36+
37+
/**
38+
* Id Annotation
39+
*
40+
* Used to define a property as the primary key of a table.
41+
*
42+
* @usage('property' => true, 'inherited' => true)
43+
*
44+
* @category Annotations
45+
* @package LightQL
46+
* @author Nana Axel <ax.lnana@outlook.com>
47+
* @link http://lightql.na2axl.tk/docs/api/LightQL/Annotations/IdAnnotation
48+
*/
49+
class IdAnnotation extends Annotation
50+
{
51+
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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 1.0.0
30+
* @link http://lightql.na2axl.tk
31+
*/
32+
33+
namespace ElementaryFramework\LightQL\Annotations;
34+
35+
use ElementaryFramework\Annotations\Annotation;
36+
37+
/**
38+
* Many-To-Many Annotation
39+
*
40+
* Used to define that a property is in a many-to-many relation with another.
41+
*
42+
* @usage('property' => true, 'inherited' => true)
43+
*
44+
* @category Annotations
45+
* @package LightQL
46+
* @author Nana Axel <ax.lnana@outlook.com>
47+
* @link http://lightql.na2axl.tk/docs/api/LightQL/Annotations/ManyToManyAnnotation
48+
*/
49+
class ManyToManyAnnotation extends Annotation
50+
{
51+
/**
52+
* The referenced entity of the many-to-many relation.
53+
*
54+
* @var string
55+
*/
56+
public $entity;
57+
58+
/**
59+
* The referenced table name of the many-to-many relation.
60+
*
61+
* @var string
62+
*/
63+
public $referencedTable;
64+
65+
/**
66+
* The column name of the many-to-many relation.
67+
*
68+
* @var string
69+
*/
70+
public $column;
71+
72+
/**
73+
* The referenced column name of the many-to-many relation.
74+
*
75+
* @var string
76+
*/
77+
public $referencedColumn;
78+
}

0 commit comments

Comments
 (0)