Skip to content

Instantly share code, notes, and snippets.

View ecomcoders's full-sized avatar

EcomCoders ecomcoders

  • EcomCoders
  • Münster/Germany
View GitHub Profile
@ecomcoders
ecomcoders / M2 config.xml
Last active August 17, 2017 14:38
Magento 2 PHPStorm File Templates
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
</default>
</config>
@ecomcoders
ecomcoders / EcomCoders.xml
Created August 7, 2017 11:41
PHPStorm Live-Templates for Magento 2 setter/getter methods
<templateSet group="EcomCoders">
<template name="m2setget" value="/**&#10;* Getter for $FIELD_UNDERSCORES$&#10;* &#10;* @return $TYPEHINT$|null&#10;*/&#10;public function get$FIELD_CAMELCASE_CAPITALIZED$()&#10;{&#10; return $this-&gt;_getData('$FIELD_UNDERSCORES$');&#10;}&#10;&#10;/**&#10;* Setter for $FIELD_UNDERSCORES$&#10;*&#10;* @param $TYPEHINT$ $$$FIELD_CAMELCASE$&#10;* @return $this&#10;*/&#10;public function set$FIELD_CAMELCASE_CAPITALIZED$($$$FIELD_CAMELCASE$)&#10;{&#10; return $this-&gt;setData('$FIELD_UNDERSCORES$', $$$FIELD_CAMELCASE$);&#10;}$END$" description="Magento2-Setter/Getter-Method" toReformat="true" toShortenFQNames="true">
<variable name="FIELD_UNDERSCORES" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="FIELD_CAMELCASE" expression="camelCase(FIELD_UNDERSCORES)" defaultValue="" alwaysStopAt="false" />
<variable name="FIELD_CAMELCASE_CAPITALIZED" expression="capitalize(camelCase(FIELD_UNDERSCORES))" defaultValue="" alwaysStopAt="false" />
<var