-
Notifications
You must be signed in to change notification settings - Fork 2
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
25 changed files
with
589 additions
and
252 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
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 |
---|---|---|
@@ -1,8 +1,7 @@ | ||
default: | ||
paths: | ||
features: %behat.paths.base%/tests/functional | ||
extensions: | ||
Behat\MinkExtension\Extension: | ||
goutte: ~ | ||
selenium2: ~ | ||
base_url: http://localhost:8080 | ||
autoload: | ||
'': %paths.base%/tests/functional | ||
suites: | ||
cli: | ||
paths: [ %paths.base%/tests/functional/cli ] | ||
contexts: [ FeatureContext ] |
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
15 changes: 15 additions & 0 deletions
15
config/xml/WilliamEspindola.Field.Entity.Collection.dcm.xml
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,15 @@ | ||
<!-- config/xml/Collection.dcm.xml --> | ||
<doctrine-mapping | ||
xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd"> | ||
|
||
<entity name="WilliamEspindola\Field\Entity\Collection"> | ||
<id name="id" type="integer"> | ||
<generator strategy="AUTO" /> | ||
</id> | ||
|
||
<field name="name" type="string" /> | ||
<field name="label" type="string" /> | ||
</entity> | ||
</doctrine-mapping> |
15 changes: 15 additions & 0 deletions
15
config/xml/WilliamEspindola.Field.Entity.CollectionField.dcm.xml
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,15 @@ | ||
<!-- config/xml/CollectionField.dcm.xml --> | ||
<doctrine-mapping | ||
xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd"> | ||
|
||
<entity name="WilliamEspindola\Field\Entity\CollectionField"> | ||
<id name="id" type="integer"> | ||
<generator strategy="AUTO" /> | ||
</id> | ||
|
||
<many-to-one field="field" target-entity="WilliamEspindola\Field\Entity\Field" /> | ||
<many-to-one field="collection" target-entity="WilliamEspindola\Field\Entity\Collection" /> | ||
</entity> | ||
</doctrine-mapping> |
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,17 @@ | ||
<!-- config/xml/Field.dcm.xml --> | ||
<doctrine-mapping | ||
xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd"> | ||
|
||
<entity name="WilliamEspindola\Field\Entity\Field"> | ||
<id name="id" type="integer"> | ||
<generator strategy="AUTO" /> | ||
</id> | ||
|
||
<field name="name" type="string" /> | ||
<field name="type" type="string" /> | ||
<field name="value" type="text" /> | ||
<field name="label" type="string" /> | ||
</entity> | ||
</doctrine-mapping> |
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 @@ | ||
<!-- config/xml/Option.dcm.xml --> | ||
<doctrine-mapping | ||
xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd"> | ||
|
||
<entity name="option"> | ||
<id name="id" type="integer"> | ||
<generator strategy="AUTO" /> | ||
</id> | ||
|
||
<field name="option" type="string" /> | ||
|
||
<many-to-one target-entity="WilliamEspindola\Field\Entity\Field" field="field" /> | ||
</entity> | ||
</doctrine-mapping> |
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
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,30 @@ | ||
<?php | ||
|
||
namespace WilliamEspindola\Field\Console\Command\Database; | ||
|
||
use WilliamEspindola\Field\Storage\ORM\Doctrine; | ||
use Doctrine\ORM\Tools\Setup; | ||
|
||
class DoctrineStorage | ||
{ | ||
protected $mapper; | ||
|
||
public function __construct($config) | ||
{ | ||
$setUp = Setup::createXMLMetadataConfiguration(array(__DIR__."/config/xml"), true); | ||
|
||
$this->mapper = new Doctrine($config, $setUp); | ||
} | ||
|
||
public function getMapperInstance() | ||
{ | ||
return $this->mapper->getMapper(); | ||
} | ||
|
||
public function getExecuteQuery($query) | ||
{ | ||
$stmt = $this->mapper->getMapper()->getConnection()->prepare($query); | ||
|
||
return $stmt->execute(); | ||
} | ||
} |
Oops, something went wrong.