snippet trans "trans"
<trans-unit id="$1">
    <source><![CDATA[$2]]></source>
    <target><![CDATA[$3]]></target>
</trans-unit>
endsnippet

snippet schema "schema"
<?xml version="1.0" encoding="UTF-8"?>
<database defaultIdMethod="native" name="default" namespace="$1">
    <vendor type="mysql">
        <parameter name="Engine" value="InnoDB" />
        <parameter name="Charset" value="utf8" />
    </vendor>

    $2
</database>
endsnippet


snippet table "table"
<table name="$1" isCrossRef="$2">
    <column name="id" type="INTEGER" primaryKey="true" required="true" autoIncrement="true" />

    <behavior name="timestampable" />

    <!--
    <foreign-key foreignTable="foo" onDelete="none" onUpdate="cascade">
        <reference local="foo_id" foreign="id" />
    </foreign-key>

    <behavior name="sortable" />
    <behavior name="uploadable">
        <parameter name="fields" value="picture" />
        <parameter name="paths" value="uploads/post/" />
    </behavior>
    -->
</table>
endsnippet

snippet id "id"
<column name="id" type="INTEGER" primaryKey="true" required="true" autoIncrement="true" />
endsnippet

snippet float "float"
<column name="$1" type="FLOAT" required="false" />
endsnippet

snippet int "int"
<column name="$1" type="INTEGER" required="false" />
endsnippet

snippet varchar "VARCHAR"
<column name="$1" type="VARCHAR" size="255" required="false" />
endsnippet

snippet bool "BOOL"
<column name="$1" type="BOOLEAN" required="true" defaultValue="false" />
endsnippet

snippet longvarchar "LONGVARCHAR"
<column name="$1" type="LONGVARCHAR" required="false" />
endsnippet

snippet fk "fk"
<column name="$1_id" type="INTEGER" required="true" />

<foreign-key foreignTable="$1" onDelete="cascade" onUpdate="cascade">
    <reference local="$1_id" foreign="id" />
</foreign-key>
<index>
    <index-column name="$1_id" />
</index>
endsnippet

snippet sort "sort"
<behavior name="sortable" />
endsnippet

snippet time "timestampable"
<behavior name="timestampable" />
endsnippet

snippet upload "upload"
<behavior name="uploadable">
    <parameter name="fields" value="$1" />
    <parameter name="paths" value="uploads/$1/" />
</behavior>
endsnippet

snippet container "service container"
<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
    </parameters>

    <services>
        $1
    </services>
</container>
endsnippet

snippet service "service of service container"
<service id="$1" class="%$1.class%">
    <tag name="" />
    <argument type="service" id="" />
    <argument>%%</argument>
</service>
<!--
<parameter key="$1.class"></parameter>
-->
endsnippet

snippet parameter "param of service container"
<parameter key="$1"></parameter>
endsnippet

snippet param "param of service container"
<parameter key="$1"></parameter>
endsnippet

snippet phpunit
<phpunit
    backupGlobals               = "false"
    backupStaticAttributes      = "false"
    colors                      = "true"
    convertErrorsToExceptions   = "true"
    convertNoticesToExceptions  = "true"
    convertWarningsToExceptions = "true"
    processIsolation            = "false"
    stopOnFailure               = "false"
    syntaxCheck                 = "true"
    bootstrap                   = "vendor/autoload.php">

    <testsuites>
        <testsuite name="$1">
            <directory>tests/</directory>
        </testsuite>
    </testsuites>
</phpunit>
endsnippet
