Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
376 additions
and
21 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,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<buildpath> | ||
<buildpathentry kind="src" path=""/> | ||
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/> | ||
</buildpath> |
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,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>Tests</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.wst.common.project.facet.core.builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.wst.validation.validationbuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.dltk.core.scriptbuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.php.core.PHPNature</nature> | ||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> | ||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature> | ||
</natures> | ||
</projectDescription> |
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,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path=""> | ||
<attributes> | ||
<attribute name="provider" value="org.eclipse.wst.jsdt.web.core.internal.project.ModuleSourcePathProvider"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject"> | ||
<attributes> | ||
<attribute name="hide" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/> | ||
<classpathentry kind="output" path=""/> | ||
</classpath> |
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,2 @@ | ||
eclipse.preferences.version=1 | ||
include_path=0;/Tests |
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,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<faceted-project> | ||
<fixed facet="php.component"/> | ||
<fixed facet="php.core.component"/> | ||
<installed facet="php.core.component" version="1"/> | ||
<installed facet="php.component" version="7.1"/> | ||
</faceted-project> |
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 @@ | ||
org.eclipse.wst.jsdt.launching.baseBrowserLibrary |
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 @@ | ||
Window |
38 changes: 38 additions & 0 deletions
38
skeleton-application/module/Fieldset/src/Entity/Attribute.php
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,38 @@ | ||
<?php | ||
namespace Fieldset\Entity; | ||
|
||
// entity to store attributes of items - ex : ingredient is having a certain color... | ||
class Attribute | ||
{ | ||
/** | ||
* @var int | ||
*/ | ||
protected $id; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $title; | ||
|
||
|
||
// Construct function with values | ||
public function __construct($id = null, $title = null) | ||
{ | ||
$this->id = $id; | ||
$this->title = $title; | ||
|
||
} | ||
|
||
|
||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
public function getTitle() | ||
{ | ||
return $this->title; | ||
} | ||
|
||
|
||
} |
38 changes: 38 additions & 0 deletions
38
skeleton-application/module/Fieldset/src/Entity/Category.php
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,38 @@ | ||
<?php | ||
namespace Fieldset\Entity; | ||
|
||
// entity to store categories of products | ||
class Category | ||
{ | ||
/** | ||
* @var int | ||
*/ | ||
protected $id; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $title; | ||
|
||
|
||
// Construct function with values | ||
public function __construct($id = null, $title = null) | ||
{ | ||
$this->id = $id; | ||
$this->title = $title; | ||
|
||
} | ||
|
||
|
||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
public function getTitle() | ||
{ | ||
return $this->title; | ||
} | ||
|
||
|
||
} |
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
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
45 changes: 45 additions & 0 deletions
45
skeleton-application/module/Fieldset/src/Service/AttributeManager.php
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,45 @@ | ||
<?php | ||
namespace Fieldset\Service; | ||
|
||
use Fieldset\Entity\Attribute; | ||
/** | ||
* This service is responsible for adding/retrieving attributes | ||
*/ | ||
class AttributeManager | ||
{ | ||
|
||
protected $attributes = array(); | ||
|
||
public function __construct($attributes= null) | ||
{ | ||
$this->attributes= $attributes; | ||
} | ||
|
||
/** | ||
* This method adds a new attribute. | ||
*/ | ||
|
||
public function addAttribute($data) | ||
{ | ||
// Create new category entity. | ||
$this->attributes[]= new Attribute($data['id'],$data['title']); | ||
|
||
} | ||
|
||
/** | ||
* Get the list of attributes | ||
*/ | ||
public function getAttributes() { | ||
|
||
$attributes= array(); | ||
|
||
// transform the object into an array for the select form | ||
foreach ($this->attributes as $object) | ||
{ | ||
$attributes[$object->getId()] = $object->getTitle(); | ||
} | ||
|
||
return $attributes; | ||
} | ||
|
||
} |
45 changes: 45 additions & 0 deletions
45
skeleton-application/module/Fieldset/src/Service/CategoryManager.php
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,45 @@ | ||
<?php | ||
namespace Fieldset\Service; | ||
|
||
use Fieldset\Entity\Category; | ||
/** | ||
* This service is responsible for adding/editing categories | ||
*/ | ||
class CategoryManager | ||
{ | ||
|
||
protected $categories = array(); | ||
|
||
public function __construct($categories = null) | ||
{ | ||
$this->categories = $categories; | ||
} | ||
|
||
/** | ||
* This method adds a new category. | ||
*/ | ||
|
||
public function addCategory($data) | ||
{ | ||
// Create new category entity. | ||
$this->categories[]= new Category($data['id'],$data['title']); | ||
|
||
} | ||
|
||
/** | ||
* Get the list of categories ? | ||
*/ | ||
public function getCategories() { | ||
|
||
$categories = array(); | ||
|
||
// transform the object into an array for the select form | ||
foreach ($this->categories as $object) | ||
{ | ||
$categories[$object->getId()] = $object->getTitle(); | ||
} | ||
|
||
return $categories; | ||
} | ||
|
||
} |
Oops, something went wrong.