<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Working With Models</title><link>https://sourceforge.net/p/yframe/wiki/Working%2520With%2520Models/</link><description>Recent changes to Working With Models</description><atom:link href="https://sourceforge.net/p/yframe/wiki/Working%20With%20Models/feed" rel="self"/><language>en</language><lastBuildDate>Mon, 10 Jun 2013 05:34:02 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/yframe/wiki/Working%20With%20Models/feed" rel="self" type="application/rss+xml"/><item><title>Working With Models modified by Ali Ghalambaz</title><link>https://sourceforge.net/p/yframe/wiki/Working%2520With%2520Models/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -56,6 +56,6 @@
 $model-&gt;myFunction([$myParameters]);

 ----------------------------------------------------------------
-Another way to declare models us yframe loader!
+Another way to declare models use yframe loader!
 $model = __loader::_model('xModel');

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ali Ghalambaz</dc:creator><pubDate>Mon, 10 Jun 2013 05:34:02 -0000</pubDate><guid>https://sourceforge.net2daa2d51acf12dbae6cc643632370160493a8bb4</guid></item><item><title>Working With Models modified by Ali Ghalambaz</title><link>https://sourceforge.net/p/yframe/wiki/Working%2520With%2520Models/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,8 +1,61 @@
-Welcome to your wiki!
+create your Models like this!

-This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].
+1- create file in app\models folder
+2- rename it to fooModel  // [foo] is your model and [Model] at end of name is Mandatory!

-The wiki uses [Markdown](/p/yframe/wiki/markdown_syntax/) syntax.
+in fooModel.php

-[[members limit=20]]
-[[download_button]]
+namespace app\models;
+use core\models\ModelAbstract;
+
+class TestModel extends ModelAbstract{
+
+   public static function  myFunction()
+   {
+        $statement = $this-&gt;connection-&gt;prepare('blob blob');
+        $statement-&gt;execute();
+   }
+}
+-----------------------------------------------------------------------
+
+//MODEL CONNECTION BASED ON PDO(PHP DATA OBJECT)
+[DECLARE MODELS]
+use app\models\xModel;
+$model = new xModel($connect_it = true,$name = 'noname' ,$user = null, $engine = null);
+
+$connect_it
+$model = new xModel(true); //default is true -   it means automatic connect to database
+$model = new xModel(false); //default is true - no connection will be create
+
+$name
+if you want to use multiple connection to one database with same username password
+for prevent collision in call function you can set name for your connection
+
+$user
+if you set multi user pass in config file you can choose which user you want to connect
+if you didn't set, default user will be connect
+
+$engine
+for example your default database engine is mysql
+now you want call this  functions' model with sql server engine, so you can set it
+
+
+[MODELS SHARED FUNCTIONS]
+
+$model-&gt;connection
+get current connection
+
+
+$model = new xModel(false);
+$model-&gt;connect($name,$user,$engine)   //if you didn't connect yet
+
+$model-&gt;getActiveConnections(); //get all connection in yframe environment
+
+
+[MODEL SPECIFIC FUNCTIONS]
+$model-&gt;myFunction([$myParameters]);
+
+----------------------------------------------------------------
+Another way to declare models us yframe loader!
+$model = __loader::_model('xModel');
+
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ali Ghalambaz</dc:creator><pubDate>Mon, 10 Jun 2013 05:32:41 -0000</pubDate><guid>https://sourceforge.net6dc360035c2e2150ac3af26459d588df240c5919</guid></item><item><title>Home modified by Ali Ghalambaz</title><link>https://sourceforge.net/p/yframe/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Welcome to your wiki!&lt;/p&gt;
&lt;p&gt;This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: &lt;span&gt;[SamplePage]&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;The wiki uses &lt;a class="" href="/p/yframe/wiki/markdown_syntax/"&gt;Markdown&lt;/a&gt; syntax.&lt;/p&gt;
&lt;p&gt;&lt;h6&gt;Project Members:&lt;/h6&gt;
&lt;ul class="md-users-list"&gt;
&lt;li&gt;&lt;a href="/u/ghalambaz/"&gt;Ali Ghalambaz&lt;/a&gt; (admin)&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;span class="download-button-51b4f1a704161f721ec94279" style="margin-bottom: 1em; display: block;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ali Ghalambaz</dc:creator><pubDate>Sun, 09 Jun 2013 21:20:39 -0000</pubDate><guid>https://sourceforge.net5bfc535680aa321a59e3c82f31143253ae3fa600</guid></item></channel></rss>