Skip to content

Instantly share code, notes, and snippets.

@JorgenVatle
Created August 26, 2018 00:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JorgenVatle/eb24229dafac8a0c4042b214dfa84458 to your computer and use it in GitHub Desktop.
Save JorgenVatle/eb24229dafac8a0c4042b214dfa84458 to your computer and use it in GitHub Desktop.
PHPStorm live template for ATShop/ATPay styled models.
<template name="mmodel" value="import { Mongo } from 'meteor/mongo';&#10;&#10;const $ModelName$Collection = new Mongo.Collection('$CollectionName$');&#10;&#10;interface $ModelName$Document extends ModelDocument {&#10; // Todo: Fill in document properties.&#10;}&#10;&#10;interface $ModelName$ extends $ModelName$Document {&#10; entry: $ModelName$Document&#10;}&#10;&#10;class $ModelName$ extends Model {&#10; &#10; /**&#10; * Mongo collection this model is responsible for.&#10; */&#10; static readonly collection = $ModelName$Collection;&#10; &#10; /**&#10; * $ModelName$ constructor.&#10; *&#10; */&#10; constructor(docOrId: DocumentOrId) {&#10; super(docOrId, $ModelName$Collection)&#10; }&#10; &#10; // Add model methods and relationships.&#10; &#10;}&#10;&#10;export default $ModelName$" description="Creates a Meteor Model class" toReformat="false" toShortenFQNames="true">
<variable name="ModelName" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="CollectionName" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="JAVA_SCRIPT" value="true" />
<option name="JSX_HTML" value="false" />
<option name="JS_CLASS" value="false" />
<option name="JS_EXPRESSION" value="false" />
</context>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment