Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
SAMBUMBA
pasteque-server
Commits
5c800687
Commit
5c800687
authored
Oct 03, 2017
by
philippepary
Browse files
Added Category model
parent
f957607f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/Model/Category.php
View file @
5c800687
...
...
@@ -26,9 +26,16 @@ use \Pasteque\Server\System\DAO\DoctrineModel;
/**
* Class Category
* @package Pasteque
* @SWG\Definition(type="object")
* @Entity
* @Table(name="categories")
* @rest\model Category
* @rest\description A category of products
* @rest\property Int id Internal ID of category for performances optimisation
* @rest\property String reference Code of the category, user-friendly ID
* @rest\property Int parent Parent's category ID, if any
* @rest\property String label Full name of the category
* @rest\property Boolean hasImage True if category has a custom image
* @rest\property Int dispOrder Display order in cash registers
*/
class
Category
extends
DoctrineModel
{
...
...
@@ -53,7 +60,6 @@ class Category extends DoctrineModel
/**
* Internal ID of the category for performance issues.
* @var integer
* @SWG\Property()
* @Id @Column(type="integer")
* @GeneratedValue
*/
...
...
@@ -64,7 +70,6 @@ class Category extends DoctrineModel
* Code of the category, user-friendly ID.
* It is automatically set from label if not explicitely set.
* @var string
* @SWG\Property()
* @Column(type="string", unique=true)
*/
protected
$reference
;
...
...
@@ -74,7 +79,6 @@ class Category extends DoctrineModel
/**
* Parent's category if any.
* @var integer
* @SWG\Property()
* @ManyToOne(targetEntity="Category", inversedBy="children")
* @JoinColumn(name="parent_id", referencedColumnName="id") */
protected
$parent
;
...
...
@@ -90,7 +94,6 @@ class Category extends DoctrineModel
/**
* Label of the category
* @var string
* @SWG\Property()
* @Column(type="string")
*/
protected
$label
;
...
...
@@ -105,7 +108,6 @@ class Category extends DoctrineModel
/**
* True if an image can be found for this model.
* @var bool
* @SWG\Property()
* @Column(type="boolean")
*/
protected
$hasImage
=
false
;
...
...
@@ -116,7 +118,6 @@ class Category extends DoctrineModel
/**
* Order of display of the category
* @var int order
* @SWG\Property(format="int32")
* @Column(type="integer", name="disp_order")
*/
protected
$dispOrder
=
0
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment