parent
e2a15244ee
commit
acb3935103
24
README.md
24
README.md
|
@ -11,15 +11,15 @@ This a propel behavior to auto-generate methods of [FOSRestBundle](http://symfon
|
|||
|
||||
```
|
||||
<table name="foo">
|
||||
<column name="id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true" />
|
||||
<column name="label" type="VARCHAR" size="256"/>
|
||||
<column name="is_active" type="BOOLEAN" size="1"/>
|
||||
<column name="id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true" />
|
||||
<column name="label" type="VARCHAR" size="256"/>
|
||||
<column name="is_active" type="BOOLEAN" size="1"/>
|
||||
|
||||
<behavior name="Deblan\Propel\Behavior\FOSRestBehavior">
|
||||
<parameter name="id" value="all"/>
|
||||
<parameter name="label" value="myGroup"/>
|
||||
<parameter name="is_active" value="myGroup, anotherGroup"/>
|
||||
</behavior>
|
||||
<behavior name="Deblan\Propel\Behavior\FOSRestBehavior">
|
||||
<parameter name="id" value="all"/>
|
||||
<parameter name="label" value="myGroup"/>
|
||||
<parameter name="is_active" value="myGroup, anotherGroup"/>
|
||||
</behavior>
|
||||
</table>
|
||||
```
|
||||
|
||||
|
@ -33,7 +33,7 @@ After the model generation, the abstract class `Foo` will be updated with new an
|
|||
*/
|
||||
abstract class Foo implements ActiveRecordInterface
|
||||
{
|
||||
...
|
||||
...
|
||||
|
||||
/**
|
||||
* @JMS\Serializer\Annotation\SerializedName("id")
|
||||
|
@ -45,7 +45,7 @@ abstract class Foo implements ActiveRecordInterface
|
|||
return $this->getId();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @JMS\Serializer\Annotation\SerializedName("label")
|
||||
* @JMS\Serializer\Annotation\Groups({"myGroup"})
|
||||
* @JMS\Serializer\Annotation\VirtualProperty
|
||||
|
@ -55,7 +55,7 @@ abstract class Foo implements ActiveRecordInterface
|
|||
return $this->getLabel();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @JMS\Serializer\Annotation\SerializedName("is_active")
|
||||
* @JMS\Serializer\Annotation\Groups({"myGroup", "anotherGroup"})
|
||||
* @JMS\Serializer\Annotation\VirtualProperty
|
||||
|
@ -65,6 +65,6 @@ abstract class Foo implements ActiveRecordInterface
|
|||
return $this->getIsActive();
|
||||
}
|
||||
|
||||
...
|
||||
...
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue