Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
fprochazka committed Dec 26, 2014
1 parent 47de466 commit 43e6220
Show file tree
Hide file tree
Showing 10 changed files with 176 additions and 296 deletions.
22 changes: 10 additions & 12 deletions Doctrine.xml
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="Doctrine">
<template name="mtm" value="/**&#10; * @ORM\ManyToMany(targetEntity=&quot;$TYPE$&quot;, $COMPLETE$=&quot;$INVERSE_PROPERTY$&quot;$END$, cascade={&quot;persist&quot;})&#10; * @ORM\JoinTable(name=&quot;$TABLE_NAME$&quot;,&#10; * &#9;&#9;joinColumns={@ORM\JoinColumn(name=&quot;$JOIN_COL$_id&quot;, referencedColumnName=&quot;id&quot;)},&#10; * &#9;&#9;inverseJoinColumns={@ORM\JoinColumn(name=&quot;$INVERSE_COL$_id&quot;, referencedColumnName=&quot;id&quot;)} &#10; * &#9;)&#10; * @var $TYPE$[]|\Doctrine\Common\Collections\ArrayCollection&#10; */&#10;protected $$$PROPERTY$;" description="ManyToMany property" toReformat="true" toShortenFQNames="true">
<variable name="PROPERTY" expression="" defaultValue="" alwaysStopAt="true" />
Expand Down Expand Up @@ -66,7 +65,7 @@
<option name="OTHER" value="false" />
</context>
</template>
<template name="otm" value="/**&#10; * @ORM\OneToMany(targetEntity=&quot;$TYPE$&quot;, mappedBy=&quot;$OTHER_PROPERTY$&quot;$END$, cascade={&quot;persist&quot;})&#10; * @var $TYPE$&#10; */&#10;protected $$$PROPERTY$;" description="OneToMany property" toReformat="true" toShortenFQNames="true">
<template name="otm" value="/**&#10; * @ORM\OneToMany(targetEntity=&quot;$TYPE$&quot;, mappedBy=&quot;$OTHER_PROPERTY$&quot;$END$, cascade={&quot;persist&quot;})&#10; * @var $TYPE$[]|\Doctrine\Common\Collections\ArrayCollection&#10; */&#10;protected $$$PROPERTY$;" description="OneToMany property" toReformat="true" toShortenFQNames="true">
<variable name="PROPERTY" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="TYPE" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
<variable name="OTHER_PROPERTY" expression="" defaultValue="" alwaysStopAt="true" />
Expand Down Expand Up @@ -105,8 +104,7 @@
<option name="OTHER" value="false" />
</context>
</template>
<template name="@dao" value="@doctrine.dao($CLASS$)" description="Doctrine DAO definition" toReformat="true" toShortenFQNames="true">
<variable name="CLASS" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
<template name="sti" value="@ORM\InheritanceType(&quot;SINGLE_TABLE&quot;)&#10; * @ORM\DiscriminatorColumn(name=&quot;type&quot;, type=&quot;string&quot;, length=10)&#10; * @ORM\DiscriminatorMap({&#10; * &quot;post&quot; = &quot;Post&quot;&#10; * })" description="Single table inheritance discriminator definition" toReformat="true" toShortenFQNames="true">
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
Expand All @@ -120,10 +118,12 @@
<option name="JAVA_SCRIPT" value="false" />
<option name="TypeScript" value="false" />
<option name="PHP" value="false" />
<option name="OTHER" value="true" />
<option name="PHP Comment" value="true" />
<option name="OTHER" value="false" />
</context>
</template>
<template name="sti" value="@ORM\InheritanceType(&quot;SINGLE_TABLE&quot;)&#10; * @ORM\DiscriminatorColumn(name=&quot;type&quot;, type=&quot;string&quot;, length=10)&#10; * @ORM\DiscriminatorMap({&#10; * &quot;post&quot; = &quot;Post&quot;&#10; * })" description="Single table inheritance discriminator definition" toReformat="true" toShortenFQNames="true">
<template name="ent" value="@ORM\Entity()&#10; * @ORM\Table(name=&quot;$TABLE_NAME$&quot;)" description="Entity header" toReformat="true" toShortenFQNames="true">
<variable name="TABLE_NAME" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
Expand All @@ -141,8 +141,8 @@
<option name="OTHER" value="false" />
</context>
</template>
<template name="ent" value="@ORM\Entity()&#10; * @ORM\Table(name=&quot;$TABLE_NAME$&quot;)" description="Entity header" toReformat="true" toShortenFQNames="true">
<variable name="TABLE_NAME" expression="" defaultValue="" alwaysStopAt="true" />
<template name="colb" value="/**&#10; * @ORM\Column(type=&quot;boolean&quot;, nullable=FALSE, options={&quot;default&quot;: 0})&#10; * @var bool&#10; */&#10;protected $$$PROPERTY$ = FALSE;$END$&#10;" description="Column property boolean type" toReformat="true" toShortenFQNames="true">
<variable name="PROPERTY" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
Expand All @@ -155,10 +155,8 @@
<option name="CSS" value="false" />
<option name="JAVA_SCRIPT" value="false" />
<option name="TypeScript" value="false" />
<option name="PHP" value="false" />
<option name="PHP Comment" value="true" />
<option name="PHP" value="true" />
<option name="OTHER" value="false" />
</context>
</template>
</templateSet>

</templateSet>
64 changes: 64 additions & 0 deletions Nette.icls
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="Nette">
<template name="com" value="/**&#10; * @return $CLASS$&#10; */&#10;protected function createComponent$NAME$()&#10;{&#10; return new $CLASS$($ARGS$);$END$&#10;}" description="component factory" toReformat="true" toShortenFQNames="true">
<variable name="CLASS" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
<variable name="ARGS" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="sig" value="/***/&#10;public function handle$NAME$($PARAMS$)&#10;{&#10; $END$&#10;}" description="signal factory" toReformat="true" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="PARAMS" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="att" value="/**&#10; * @param \Nette\ComponentModel\Container $obj&#10; */&#10;protected function attached($obj)&#10;{&#10;&#9;parent::attached($obj);&#10;&#10;&#9;if (!$obj instanceof \Nette\Application\UI\Presenter) {&#10;&#9;&#9;return;&#10;&#9;}&#10;&#10;&#9;$END$&#10;}" description="component attached event" toReformat="true" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="obj" value="&#9;/*************************** Nette\Object ***************************/&#10;&#10;&#10;&#10;&#9;/**&#10;&#9; * Access to reflection.&#10;&#9; * @return \Nette\Reflection\ClassType&#10;&#9; */&#10;&#9;public static function getReflection()&#10;&#9;{&#10;&#9;&#9;return new Nette\Reflection\ClassType(get_called_class());&#10;&#9;}&#10;&#10;&#10;&#10;&#9;/**&#10;&#9; * Call to undefined method.&#10;&#9; *&#10;&#9; * @param string $name&#10;&#9; * @param array $args&#10;&#9; *&#10;&#9; * @throws \Nette\MemberAccessException&#10;&#9; * @return mixed&#10;&#9; */&#10;&#9;public function __call($name, $args)&#10;&#9;{&#10;&#9;&#9;return Nette\ObjectMixin::call($this, $name, $args);&#10;&#9;}&#10;&#10;&#10;&#10;&#9;/**&#10;&#9; * Call to undefined static method.&#10;&#9; *&#10;&#9; * @param string $name&#10;&#9; * @param array $args&#10;&#9; *&#10;&#9; * @throws \Nette\MemberAccessException&#10;&#9; * @return mixed&#10;&#9; */&#10;&#9;public static function __callStatic($name, $args)&#10;&#9;{&#10;&#9;&#9;return Nette\ObjectMixin::callStatic(get_called_class(), $name, $args);&#10;&#9;}&#10;&#10;&#10;&#10;&#9;/**&#10;&#9; * Adding method to class.&#10;&#9; *&#10;&#9; * @param $name&#10;&#9; * @param null $callback&#10;&#9; *&#10;&#9; * @throws \Nette\MemberAccessException&#10;&#9; * @return callable|null&#10;&#9; */&#10;&#9;public static function extensionMethod($name, $callback = NULL)&#10;&#9;{&#10;&#9;&#9;if (strpos($name, '::') === FALSE) {&#10;&#9;&#9;&#9;$class = get_called_class();&#10;&#9;&#9;} else {&#10;&#9;&#9;&#9;list($class, $name) = explode('::', $name);&#10;&#9;&#9;}&#10;&#9;&#9;if ($callback === NULL) {&#10;&#9;&#9;&#9;return Nette\ObjectMixin::getExtensionMethod($class, $name);&#10;&#9;&#9;} else {&#10;&#9;&#9;&#9;Nette\ObjectMixin::setExtensionMethod($class, $name, $callback);&#10;&#9;&#9;}&#10;&#9;}&#10;&#10;&#10;&#10;&#9;/**&#10;&#9; * Returns property value. Do not call directly.&#10;&#9; *&#10;&#9; * @param string $name&#10;&#9; *&#10;&#9; * @throws \Nette\MemberAccessException&#10;&#9; * @return mixed&#10;&#9; */&#10;&#9;public function &amp;__get($name)&#10;&#9;{&#10;&#9;&#9;return Nette\ObjectMixin::get($this, $name);&#10;&#9;}&#10;&#10;&#10;&#10;&#9;/**&#10;&#9; * Sets value of a property. Do not call directly.&#10;&#9; *&#10;&#9; * @param string $name&#10;&#9; * @param mixed $value&#10;&#9; *&#10;&#9; * @throws \Nette\MemberAccessException&#10;&#9; * @return void&#10;&#9; */&#10;&#9;public function __set($name, $value)&#10;&#9;{&#10;&#9;&#9;Nette\ObjectMixin::set($this, $name, $value);&#10;&#9;}&#10;&#10;&#10;&#10;&#9;/**&#10;&#9; * Is property defined?&#10;&#9; *&#10;&#9; * @param string $name&#10;&#9; *&#10;&#9; * @return bool&#10;&#9; */&#10;&#9;public function __isset($name)&#10;&#9;{&#10;&#9;&#9;return Nette\ObjectMixin::has($this, $name);&#10;&#9;}&#10;&#10;&#10;&#10;&#9;/**&#10;&#9; * Access to undeclared property.&#10;&#9; *&#10;&#9; * @param string $name&#10;&#9; *&#10;&#9; * @throws \Nette\MemberAccessException&#10;&#9; * @return void&#10;&#9; */&#10;&#9;public function __unset($name)&#10;&#9;{&#10;&#9;&#9;Nette\ObjectMixin::remove($this, $name);&#10;&#9;}" description="Nette\Object mixin" toReformat="true" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="inj" value="/**&#10; * @param $HINT$ $$$SERVICE$&#10; */&#10;public function inject$SERVICE_UPER$($HINT$ $$$SERVICE$)&#10;{&#10; $this-&gt;$SERVICE$ = $$$SERVICE$;$END$&#10;}" description="inject function" toReformat="true" toShortenFQNames="true">
<variable name="SERVICE" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="HINT" expression="classNameComplete()" defaultValue="" alwaysStopAt="true" />
<variable name="SERVICE_UPER" expression="capitalize(SERVICE)" defaultValue="" alwaysStopAt="false" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="sup" value="protected function startup()&#10;{&#10; parent::startup();&#10;&#10; $END$&#10;}" description="startup method" toReformat="true" toShortenFQNames="true">
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="form" value="/**&#10; * @return $FORM_CLASS$&#10; */&#10;protected function createComponent$NAME$()&#10;{&#10;&#9;$$form = new $FORM_CLASS$();&#10;&#9;$END$&#10;&#10; $$form-&gt;addSubmit(&quot;send&quot;, &quot;Odeslat&quot;);&#10;&#9;$$form-&gt;onSuccess[] = $this-&gt;$HANDLER$Succeeded;&#10;&#10;&#9;return $$form;&#10;}&#10;&#10;&#10;&#10;/**&#10; * @param $FORM_CLASS$ $$form&#10; */&#10;public function $HANDLER$Succeeded($FORM_CLASS$ $$form)&#10;{&#10;&#9;throw new Nette\NotImplementedException;&#10;}" description="Form component factory + handler" toReformat="false" toShortenFQNames="true">
<variable name="NAME" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="FORM_CLASS" expression="enum(&quot;Form&quot;, &quot;UI\\Form&quot;, &quot;Nette\\Application\\UI\\Form&quot;)" defaultValue="Form" alwaysStopAt="true" />
<variable name="HANDLER" expression="decapitalize(NAME)" defaultValue="" alwaysStopAt="false" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="ren" value="public function render$VIEW$($PARAMS$)&#10;{&#10;&#9;$END$&#10;}" description="Render method" toReformat="false" toShortenFQNames="true">
<variable name="VIEW" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="PARAMS" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
<template name="act" value="public function action$ACTION$($PARAMS$)&#10;{&#10;&#9;$END$&#10;}" description="Action method" toReformat="false" toShortenFQNames="true">
<variable name="ACTION" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="PARAMS" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="PHP" value="true" />
</context>
</template>
</templateSet>

0 comments on commit 43e6220

Please sign in to comment.