Skip to content

Commit

Permalink
Merge pull request #460 from anzin/add-templates-desc-to-data-model-a…
Browse files Browse the repository at this point in the history
…nd-data-model-interface

Added templates descriptions for Magento Data Model and Magento Data Model Interface
  • Loading branch information
coderimus authored Jan 25, 2021
2 parents 3ef179e + 1e56d54 commit 41a28d4
Show file tree
Hide file tree
Showing 2 changed files with 140 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!--
/*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<html lang="en">
<body>
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
<tr>
<td><font face="verdana" size="-1">
The data model interface indicates all the setters and getters for the related data model.
This used to maintain the integrity of the data, even if there is any changes in the model you will always get consistent data.
</font><br>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
<tr>
<td colspan="3"><font face="verdana" size="-1">Predefined variables explanation:</font></td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${NAMESPACE}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">A fully qualified name of the field namespace without a leading slash.
</font>
</td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${USE}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">List of imports separated by comma.
</font>
</td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${NAME}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">PHP Class name.
</font>
</td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${EXTENDS}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">Name of PHP class that the Class extends.
</font>
</td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${IMPLEMENTS}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">Name of PHP class that the Class implements.
</font>
</td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${PROPERTIES}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">Class member variables.
</font>
</td>
</tr>
</table>
</body>
</html>
74 changes: 74 additions & 0 deletions resources/fileTemplates/internal/Magento Data Model.php.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<!--
/*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<html lang="en">
<body>
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
<tr>
<td><font face="verdana" size="-1">
The data model is a stateful data transfer object (DTO) that introduces simple data PHP object that contains only getters and setters.
In other words, data models are interfaces that define the list of data properties other components can expect from them.
</font><br>
</td>
</tr>
<tr>
<td><font face="verdana" size="-1">
Link to documentation
<a href="https://www.mageplaza.com/magento-2-module-development/how-to-create-crud-model-magento-2.html">
DevDocs</a>.
</font><br>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
<tr>
<td colspan="3"><font face="verdana" size="-1">Predefined variables explanation:</font></td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${NAMESPACE}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">A fully qualified name of the field namespace without a leading slash.
</font>
</td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${USE}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">List of imports separated by comma.
</font>
</td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${NAME}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">PHP Class name.
</font>
</td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${EXTENDS}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">Name of PHP class that the Class extends.
</font>
</td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${IMPLEMENTS}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">Name of PHP class that the Class implements.
</font>
</td>
</tr>
<tr>
<td valign="top"><nobr><font face="verdana" size="-2"><b>${PROPERTIES}</b></font></nobr></td>
<td width="10">&nbsp;</td>
<td width="100%" valign="top"><font face="verdana" size="-1">Class member variables.
</font>
</td>
</tr>
</table>
</body>
</html>

0 comments on commit 41a28d4

Please sign in to comment.