Skip to content

Instantly share code, notes, and snippets.

View michaelyeg's full-sized avatar

Michael Xi michaelyeg

View GitHub Profile
@Nemo64
Nemo64 / doctrine_live_tempaltes.xml
Created March 29, 2021 11:42
Live templates for common doctrine fields
<template name="bool:default" value="/**&#10; * @var bool&#10; * @ORM\Column(type=&quot;boolean&quot;, options={&quot;default&quot;: $default$})&#10; */&#10;private bool $$$name$ = $default$;&#10;&#10;$END$&#10;&#10;public function is$method$(): bool&#10;{&#10; return $this-&gt;$name$;&#10;}&#10;&#10;public function set$method$(bool $$$name$): void&#10;{&#10; $this-&gt;$name$ = $$$name$;&#10;}" description="boolean column" toReformat="false" toShortenFQNames="true">
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="default" expression="enum(&quot;false&quot;, &quot;true&quot;)" defaultValue="" alwaysStopAt="true" />
<variable name="method" expression="capitalize(name)" defaultValue="" alwaysStopAt="false" />
<context>
<option name="PHP Class Member" value="true" />
</context>
</template>
<template name="bool:nullable" value="/**&#10; * @var bool|null&#10; * @ORM\Column(type=&quot;boolean&quot;, nullable=true)&#10; */&#10;private ?bool $$$name$ = nul