<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.7.6(BH)" -->
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>Documentation</title>
        <description></description>
        <link>http://www.midgard-project.org/documentation/</link>
        <lastBuildDate>Thu, 15 May 2008 07:20:58 +0000</lastBuildDate>
        <generator>FeedCreator 1.7.6(BH)</generator>
        <item>
            <title>Debian</title>
            <link>http://www.midgard-project.org/documentation/installation-distros-debian/</link>
            <description>&lt;p&gt;Add the following lines to &lt;code&gt;/etc/apt/sources.list&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
Replace binary-i386 with binary-amd64 for 64bit environments.
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;For Debian stable &lt;strong&gt;( etch )&lt;/strong&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;deb http://www.midgard-project.org/debian/dists/stable/main/binary-i386 ./  
# deb-src http://www.midgard-project.org/debian/dists/stable/source/ ./
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For Debian testing &lt;strong&gt;( lenny )&lt;/strong&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;deb http://www.midgard-project.org/debian/dists/testing/main/binary-i386 ./  
# deb-src  http://www.midgard-project.org/debian/dists/testing/source/ ./
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For Debian unstable &lt;strong&gt;( sid )&lt;/strong&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;deb http://www.midgard-project.org/debian/dists/unstable/main/binary-i386 ./  
# deb-src http://www.midgard-project.org/debian/dists/unstable/source/ ./
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run &lt;code&gt;apt-get update&lt;/code&gt; for updating the apt database (this adds our repository into your apt).&lt;/p&gt;

&lt;p&gt;If you're installing for Apache HTTP Server 1.3.X series, install Midgard with the command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;apt-get install midgard-data php4-midgard.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you're installing for Apache HTTP Server 2.X series, install Midgard with the command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;apt-get install midgard-data libapache2-mod-midgard
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Unfortunatelly there is no empty &quot;midgard&quot; package, as we need to provide support for both Apache HTTP Server series.&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;datagard&lt;/code&gt; for setting up a new Midgard database and virtual host. Read the instructions from &lt;a href=&quot;http://www.midgard-project.org/documentation/installation-database/&quot; class=&quot;wikipage &quot; title=&quot;Setting Up a Midgard Database&quot;&gt;Setting Up a Midgard Database&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Debian sarge&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;For old stable debian:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;deb http://www.midgard-project.org/debian/dists/sarge/main/binary-i386 ./
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Midgard packages for debian sarge include php5-midgard package. This package is built against php5 packages available from &lt;a href=&quot;http://dotdeb.org&quot;&gt;http://dotdeb.org&lt;/a&gt;. If you want to you PHP5 and php5-midgard on sarge, add dotdeb repository to your sources.list  and install php5 and php5-midgard.&lt;/p&gt;

&lt;p&gt;For Debian Sarge, you currently have to edit the &lt;code&gt;/etc/apache2/apache2.conf&lt;/code&gt; and add:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Include /etc/midgard/apache/httpd.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Also you must comment out the &lt;code&gt;Listen 80&lt;/code&gt; entry in &lt;code&gt;/etc/apache2/ports.conf&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;note&quot;&gt;
If you are running other vhosts on the box, you might have to do more.
&lt;/div&gt;

&lt;p&gt;If, after following all the instructions regarding the installation with Debian packages, you end up with a broken homepage, try this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;* Try the /aegir/ url (as a suffix to your virtual host URL)
* Check inside the midgard database if you have a host (in the host table) without a prefix (you should, otherwise do the following)
* Restart de datagard application and select Update - Upgrade ...
* If debconf crashes with a geometry error (something about coordinates in the graphical size), resize the window and try again
* Retry using the /aegir/ suffix and use the default admin password &quot;password&quot;
&lt;/code&gt;&lt;/pre&gt;
</description>
            <pubDate>Tue, 15 Apr 2008 11:19:07 +0000</pubDate>
        </item>
        <item>
            <title>midgard_replicator method import_from_xml</title>
            <link>http://www.midgard-project.org/documentation/midgard_replicator-method-import_from_xml/</link>
            <description>&lt;p&gt;Imports data from xml content.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;void&lt;/em&gt; &lt;strong&gt;import_from_xml(&lt;em&gt;string&lt;/em&gt; xml);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Minimum version: 1.8.1&lt;/p&gt;

&lt;p&gt;This method takes one parameter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;xml&lt;/em&gt;, valid xml content&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You should use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/midgard_replicator-method-serialize/&quot; class=&quot;wikipage default&quot; title=&quot;midgard_replicator method serialize&quot;&gt;serialize method&lt;/a&gt; if you need serialized object's data.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/midgard_replicator-method-export_blob/&quot; class=&quot;wikipage default&quot; title=&quot;midgard_replicator method export_blob&quot;&gt;export_blob method&lt;/a&gt; if you need to export midgard_attachment's binary data&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/midgard_replicator-method-export_purged/&quot; class=&quot;wikipage default&quot; title=&quot;midgard_replicator method export_purged&quot;&gt;export_purged method&lt;/a&gt; if you need to export all objects which have previously been purged.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Examples&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;$xml = file_get_contents(&quot;exported.xml&quot;);
midgard_replicator::import_from_xml($xml);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php-midgard_replicator/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_replicator&quot;&gt;PHP midgard_replicator&lt;/a&gt;&lt;/p&gt;
</description>
            <pubDate>Fri, 04 Apr 2008 19:37:41 +0000</pubDate>
        </item>
        <item>
            <title>MgdSchema method connect</title>
            <link>http://www.midgard-project.org/documentation/mgdschema_method_connect/</link>
            <description>&lt;p&gt;__void $object-&gt;connect(event_name, array callback, [array params])__&lt;/p&gt;

&lt;p&gt;Minimum version: Midgard 1.9&lt;/p&gt;

&lt;p&gt;Connects callback to &lt;a href=&quot;http://www.midgard-project.org/documentation/php_events/&quot; class=&quot;wikipage default&quot; title=&quot;PHP Events&quot;&gt;event&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This method takes three arguments:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;event_name&lt;/strong&gt;, a name of the event for which callback is connected to, for example &lt;code&gt;action_update_hook&lt;/code&gt;, &lt;code&gt;action_created&lt;/code&gt; or &lt;code&gt;action_loaded&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;callback&lt;/strong&gt;, an array which is user defined PHP callback&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;params&lt;/strong&gt;, an array with parameters which will be passed to callback&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A &lt;a href=&quot;http://www.php.net/callback&quot;&gt;callback&lt;/a&gt; function is connected to event(signal) emited by instance which invokes connect method. You may connect to one instance and event as many callbacks as you need.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php  

function my_callback($object, $data)
{
    echo &quot;Connected to &quot;.$object-&amp;gt;guid;
    echo &quot;And have special data &quot;.$data;   
}

$article = midgard_object_class::factory(&quot;midgard_article&quot;, 123);
$article-&amp;gt;connect(&quot;action_update_hook&quot;, array(&quot;my_callback&quot;), array(&quot;abc&quot;));

$article-&amp;gt;update();

?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Read more about &lt;a href=&quot;http://www.midgard-project.org/documentation/php_events/&quot; class=&quot;wikipage default&quot; title=&quot;PHP Events&quot;&gt;events&lt;/a&gt;.&lt;/p&gt;
</description>
            <pubDate>Fri, 04 Apr 2008 08:24:21 +0000</pubDate>
        </item>
        <item>
            <title>PHP midgard_connection method connect</title>
            <link>http://www.midgard-project.org/documentation/php_midgard_connection_method_connect/</link>
            <description>&lt;p&gt;Connects a callback.&lt;/p&gt;

&lt;p&gt;Name of this method may be confusing, as it may suggest database connection.
&lt;strong&gt;connect&lt;/strong&gt; method name is reserved for all midgard objects, and it's related to &lt;a href=&quot;http://www.midgard-project.org/documentation/php_events/&quot; class=&quot;wikipage default&quot; title=&quot;PHP events&quot;&gt;events handling&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Read about &lt;a href=&quot;http://www.midgard-project.org/documentation/mgdschema_method_connect/&quot; class=&quot;wikipage default&quot; title=&quot;mgdschema method connect&quot;&gt;mgdschema method connect&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt;.&lt;/p&gt;
</description>
            <pubDate>Fri, 04 Apr 2008 08:23:30 +0000</pubDate>
        </item>
        <item>
            <title>PHP midgard_connection method set_debuglevel</title>
            <link>http://www.midgard-project.org/documentation/php_midgard_connection_method_set_debuglevel/</link>
            <description>&lt;p&gt;Set log verbosity level.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;void&lt;/em&gt; &lt;strong&gt;set_debuglevel(level);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt; method &lt;strong&gt;set_debuglevel&lt;/strong&gt; takes one parameter and may be called &lt;strong&gt;statically&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;level &lt;em&gt;string&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Available and usable levels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;warn ( or warning)&lt;/li&gt;
&lt;li&gt;info&lt;/li&gt;
&lt;li&gt;message&lt;/li&gt;
&lt;li&gt;debug&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The default &lt;em&gt;warn&lt;/em&gt; will produce only warning logs. &lt;em&gt;info&lt;/em&gt; and &lt;em&gt;message&lt;/em&gt; provides functions and method names be written to log file with additional messages produced by invoked functions. &lt;em&gt;debug&lt;/em&gt; produces function and method names and all SQL queries.&lt;/p&gt;

&lt;p&gt;You may set debuglevel as many time as needed during runtime. Log level is limited to currently invoked application, even if more than one reuse the same configuration and underlying connection to the same database.&lt;/p&gt;

&lt;p&gt;This method overwrites loglevel set in &lt;a href=&quot;http://www.midgard-project.org/documentation/unified-configuration/&quot; class=&quot;wikipage &quot; title=&quot;unified configuration&quot;&gt;unified configuration&lt;/a&gt;. Log messages may be written to defined log file.&lt;/p&gt;

&lt;h2&gt;Example&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php

 midgard_connection::set_debuglevel(&quot;info&quot;);

 try
 {
     $object = midgard_person(123);
 }
 catch(midgard_error_exception $e)
 {
     echo &quot;Failed to get object&quot; . $e-&amp;gt;getMessage();
 }

 $object-&amp;gt;lastname = &quot;Smith&quot;;

 midgard_connection::set_debuglevel(&quot;debug&quot;);

 if(!$object-&amp;gt;update()) {

     if(midgard_connection::get_error() = MGD_ERR_ACCESS_DENIED)
         echo &quot;You are not allowed to edit this document&quot;; 
 } 

 midgard_connection::set_debuglevel(&quot;warn&quot;)

 ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt;.&lt;/p&gt;
</description>
            <pubDate>Fri, 04 Apr 2008 08:17:49 +0000</pubDate>
        </item>
        <item>
            <title>PHP midgard_connection method get_user</title>
            <link>http://www.midgard-project.org/documentation/php_midgard_connection_method_get_user/</link>
            <description>&lt;p&gt;Get midgard_user.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;midgard_user&lt;/em&gt; &lt;strong&gt;get_user(void);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt; method &lt;strong&gt;get_user&lt;/strong&gt; takes no parameters and may be called &lt;strong&gt;statically&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Returns midgard_user object, or &lt;em&gt;NULL&lt;/em&gt; if there's no authenticated user.&lt;/p&gt;

&lt;p&gt;Read about &lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_user/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_user&quot;&gt;midgard_user&lt;/a&gt; class.&lt;/p&gt;

&lt;h2&gt;Example&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php

 $user = midgard_connection::get_user();

 if(!$user-&amp;gt;is_admin())
 {
     echo &quot;You are not allowed to edit this document&quot;;
 }

 ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt;.&lt;/p&gt;
</description>
            <pubDate>Fri, 04 Apr 2008 08:06:09 +0000</pubDate>
        </item>
        <item>
            <title>PHP midgard_connection method get_error_string</title>
            <link>http://www.midgard-project.org/documentation/php_midgard_connection_method_get_error_string/</link>
            <description>&lt;p&gt;Get latest error string.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;string&lt;/em&gt; &lt;strong&gt;get_error_string(void);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt; method &lt;strong&gt;get_error_string&lt;/strong&gt; takes no parameters and may be called &lt;strong&gt;statically&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Returns error string.&lt;/p&gt;

&lt;h2&gt;Example&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php

 try
 {
     $object = midgard_person(1);
 }
 catch(midgard_error_exception $e)
 {
     echo &quot;Failed to get object&quot; . $e-&amp;gt;getMessage();
 }

 $object-&amp;gt;lastname = &quot;Smith&quot;;

 if(!$object-&amp;gt;update()) {

     echo midgard_connection::get_error_string();
 } 

 ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt;.&lt;/p&gt;
</description>
            <pubDate>Fri, 04 Apr 2008 07:59:17 +0000</pubDate>
        </item>
        <item>
            <title>PHP midgard_connection method get_error</title>
            <link>http://www.midgard-project.org/documentation/php_midgard_connection_method_get_error/</link>
            <description>&lt;p&gt;Get latest error id.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;int&lt;/em&gt; &lt;strong&gt;get_error(void);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt; method &lt;strong&gt;get_error&lt;/strong&gt; takes no parameters and may be called &lt;strong&gt;statically&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Returns error constant id.&lt;/p&gt;

&lt;p&gt;List or error ids is documented in midgard-core documentation.&lt;/p&gt;

&lt;h2&gt;Example&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php

 try
 {
     $object = midgard_person(0);
 }
 catch(midgard_error_exception $e)
 {
     echo &quot;Failed to get object&quot; . $e-&amp;gt;getMessage();
 }

 $object-&amp;gt;lastname = &quot;Smith&quot;;

 if(!$object-&amp;gt;update()) {

     if(midgard_connection::get_error() == MGD_ERR_NOT_EXISTS)
         echo &quot;Can not update object which doesn't exist&quot;; 
 } 

 ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt;.&lt;/p&gt;
</description>
            <pubDate>Fri, 04 Apr 2008 07:55:59 +0000</pubDate>
        </item>
        <item>
            <title>PHP midgard_connection</title>
            <link>http://www.midgard-project.org/documentation/php_midgard_connection/</link>
            <description>&lt;div class=&quot;note&quot;&gt;
This part of API is forward compatible and it's recommended for Midgard 1.9/2.0. This is experimental section.
&lt;/div&gt;

&lt;p&gt;MidgardConnection (&lt;strong&gt;midgard_connection&lt;/strong&gt;) class initializes new Midgard connection and is responsible for holding and setting environmental variables ( like language, sitegroup, errors ). On PHP level is implemented as &lt;strong&gt;singleton&lt;/strong&gt; object, and once connection object is created, it's available as $_MIDGARD_CONNECTION superglobal.&lt;/p&gt;

&lt;p&gt;Minimum version: 1.9&lt;/p&gt;

&lt;h2&gt;Creating new midgard_connection ( constructor )&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;midgard_connection&lt;/strong&gt; object is instantiated without arguments.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$cnc = new midgard_connection();
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You do not have to store and keep reference to newly created object.
Both calls are equal:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$cnc-&amp;gt;open(&quot;midgard&quot;);
$_MIDGARD_CONNECTION-&amp;gt;open(&quot;midgard&quot;);
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Midgard Connection methods&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_connection_method_open/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_connection method open&quot;&gt;open&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_connection_method_open_config/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_connection method open_config&quot;&gt;open_config&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_connection_method_set_sitegroup/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_connection method set_sitegroup&quot;&gt;set_sitegroup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_connection_method_get_sitegroup/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_connection method get_sitegroup&quot;&gt;get_sitegroup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_connection_method_set_lang/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_connection method set_lang&quot;&gt;set_lang&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_connection_method_get_lang/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_connection method get_lang&quot;&gt;get_lang&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_connection_method_get_error/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_connection method get_error&quot;&gt;get_error&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_connection_method_get_error_string/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_connection method get_error_string&quot;&gt;get_error_string&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_connection_method_get_user/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_connection method get_user&quot;&gt;get_user&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_connection_method_set_debuglevel/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_connection method set_debuglevel&quot;&gt;set_debuglevel&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_connection_method_connect/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_connection method connect&quot;&gt;connect&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
            <pubDate>Fri, 04 Apr 2008 07:44:16 +0000</pubDate>
        </item>
        <item>
            <title>PHP midgard_connection method get_lang</title>
            <link>http://www.midgard-project.org/documentation/php_midgard_connection_method_get_lang/</link>
            <description>&lt;p&gt;Get runtime language.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;mixed&lt;/em&gt; &lt;strong&gt;get_lang(void);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt; method &lt;strong&gt;get_lang&lt;/strong&gt; takes no parameters and may be called &lt;strong&gt;statically&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Returns two letter language code, which confirms &lt;a href=&quot;http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes&quot;&gt;ISO 639-1&lt;/a&gt; standard. 
&lt;em&gt;NULL&lt;/em&gt; is returned if runtime language is set to 0 ( no language context ).&lt;/p&gt;

&lt;h2&gt;Example&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php

 $lang_code midgard_connection::get_lang();

 if(is_null($lang_code))
 {
     echo &quot;No language set&quot;;
 }
 else 
 {
     echo &quot;Language context is {$lang_code}&quot;; 
 } 

 ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt;.&lt;/p&gt;
</description>
            <pubDate>Fri, 04 Apr 2008 07:42:58 +0000</pubDate>
        </item>
        <item>
            <title>PHP midgard_connection method set_lang</title>
            <link>http://www.midgard-project.org/documentation/php_midgard_connection_method_set_lang/</link>
            <description>&lt;p&gt;Set runtime language.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;boolean&lt;/em&gt; &lt;strong&gt;set_lang(code);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt; method &lt;strong&gt;set_lang&lt;/strong&gt; takes one parameter and may be called &lt;strong&gt;statically&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;language code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Language code should confirm &lt;a href=&quot;http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes&quot;&gt;ISO 639-1&lt;/a&gt; standard. Yuo may use built-in &lt;em&gt;midgard_language&lt;/em&gt; class to list all available languages and codes.&lt;/p&gt;

&lt;p&gt;Returns &lt;strong&gt;TRUE&lt;/strong&gt; if language is changed, &lt;strong&gt;FALSE&lt;/strong&gt; otherwise.&lt;/p&gt;

&lt;p&gt;'lang-changed' signal is emitted if language has been changed. You might want to invoke your own callback when &lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_connection_method_connect/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_connection method connect&quot;&gt;connected&lt;/a&gt; to $_MIDGARD_CONNECTION.&lt;/p&gt;

&lt;h2&gt;Example&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php

 $lang_code = 'pl';
 midgard_connection::set_lang($lang_code);

 ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt;.&lt;/p&gt;
</description>
            <pubDate>Fri, 04 Apr 2008 07:34:39 +0000</pubDate>
        </item>
        <item>
            <title>PHP midgard_connection method get_sitegroup</title>
            <link>http://www.midgard-project.org/documentation/php_midgard_connection_method_get_sitegroup/</link>
            <description>&lt;p&gt;Get runtime sitegroup.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;mixed&lt;/em&gt; &lt;strong&gt;get_sitegroup(void);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt; method &lt;strong&gt;get_sitegroup&lt;/strong&gt; takes no parameters and may be called &lt;strong&gt;statically&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Returns the name of the sitegroup for which application's sitegroup context is set. NULL is returned, if runtime sitegroup is 0.&lt;/p&gt;

&lt;h2&gt;Example&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php

 $name = midgard_connection::get_sitegroup();

 echo &quot;You are currently working in {$name} sitegroup&quot;

 ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt;.&lt;/p&gt;
</description>
            <pubDate>Thu, 03 Apr 2008 20:28:20 +0000</pubDate>
        </item>
        <item>
            <title>PHP midgard_connection method set_sitegroup</title>
            <link>http://www.midgard-project.org/documentation/php_midgard_connection_method_set_sitegroup/</link>
            <description>&lt;p&gt;Set runtime sitegroup.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;boolean&lt;/em&gt; &lt;strong&gt;set_sitegroup(name);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt; method &lt;strong&gt;set_sitegroup&lt;/strong&gt; takes one parameter and may be called &lt;strong&gt;statically&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sitegroup name&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Returns &lt;strong&gt;TRUE&lt;/strong&gt; if sitegroup is changed, &lt;strong&gt;FALSE&lt;/strong&gt; otherwise.&lt;/p&gt;

&lt;p&gt;'sitegroup-changed' signal is emitted if sitegroup has been changed. You might want to invoke your own callback when &lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_connection_method_connect/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_connection method connect&quot;&gt;connected&lt;/a&gt; to $_MIDGARD_CONNECTION.&lt;/p&gt;

&lt;h2&gt;Example ( using legacy MidgardSitegroup object )&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php

 $legacy = mgd_get_sitegroup(1);

 midgard_connection::set_sitegroup($legacy-&amp;gt;name);

 ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt;.&lt;/p&gt;
</description>
            <pubDate>Thu, 03 Apr 2008 20:22:23 +0000</pubDate>
        </item>
        <item>
            <title>PHP midgard_connection method open_config</title>
            <link>http://www.midgard-project.org/documentation/php_midgard_connection_method_open_config/</link>
            <description>&lt;p&gt;Create new connection using given configuration.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;boolean&lt;/em&gt; &lt;strong&gt;open_config(&lt;em&gt;midgard_config&lt;/em&gt; config);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt; method &lt;strong&gt;open_config&lt;/strong&gt; takes one parameter.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;midgard_config instance&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Returns &lt;strong&gt;TRUE&lt;/strong&gt; if connection has been established for given configuration, &lt;strong&gt;FALSE&lt;/strong&gt; otherwise.&lt;/p&gt;

&lt;h2&gt;Example&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php

 try {
     $config = new midgard_config();
 } catch (Exception $e) {
     echo $e-&amp;gt;getMessage();  
 }

 try {
     $cnc = new midgard_connection();
 } catch (Exception $e) {
     echo $e-&amp;gt;getMessage();  
 }

 if(!$config-&amp;gt;read_file('midgard', true) 
 {
     echo &quot;Couldn't open configuration from user directory&quot;;
     exit; 
 }

 if(!$cnc-&amp;gt;open_config($config))
     echo &quot;Could not connect with given configuration name&quot;;     
 ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt;.&lt;/p&gt;
</description>
            <pubDate>Thu, 03 Apr 2008 20:11:33 +0000</pubDate>
        </item>
        <item>
            <title>PHP Midgard Core</title>
            <link>http://www.midgard-project.org/documentation/php_midgard_core/</link>
            <description>&lt;h1&gt;Midgard Core API&lt;/h1&gt;

&lt;p&gt;Includes built in Midgard Classes&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_config&lt;/span&gt;&lt;/strong&gt; - System wide or personal configurations and database management&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt;&lt;/strong&gt; - Connection handling and environment variables&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_user&lt;/span&gt;&lt;/strong&gt; - User accounts and authentication&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_blob&lt;/span&gt;&lt;/strong&gt; - Files and binary data&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;User defined class' support&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/midgardquerybuilder/&quot; class=&quot;wikipage &quot; title=&quot;MidgardQueryBuilder&quot;&gt;Query Builder&lt;/a&gt;&lt;/strong&gt; - Database object query API&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php-midgard_collector/&quot; class=&quot;wikipage &quot; title=&quot;PHP midgard_collector&quot;&gt;Collector&lt;/a&gt;&lt;/strong&gt; - Optimized database query API that doesn't return objects&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Reflection like semi class&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_object_class API&lt;/span&gt;&lt;/strong&gt; - A helper for Mgdschema classes&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Reflection&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;Midgard Reflection Property API&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Metadata&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/mgdschema-metadata-object/&quot; class=&quot;wikipage &quot; title=&quot;MgdSchema metadata object&quot;&gt;midgard_metadata&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Replication&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_replicator API&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;MgdSchema API&lt;/h1&gt;

&lt;p&gt;User defined classes API&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/mgdschema-in-php/&quot; class=&quot;wikipage &quot; title=&quot;MgdSchema in PHP&quot;&gt;MgdSchema objects&lt;/a&gt;&lt;/strong&gt; - Data handling API&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;Events&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_events/&quot; class=&quot;wikipage default&quot; title=&quot;PHP Events&quot;&gt;Handling events&lt;/a&gt;&lt;/strong&gt; - Handling events&lt;/li&gt;
&lt;/ul&gt;
</description>
            <pubDate>Thu, 03 Apr 2008 20:04:47 +0000</pubDate>
        </item>
        <item>
            <title>PHP midgard_connection method open</title>
            <link>http://www.midgard-project.org/documentation/php_midgard_connection_method_open/</link>
            <description>&lt;p&gt;Create new connection using named configuration.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;boolean&lt;/em&gt; &lt;strong&gt;open(name);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;wiki_missing_nouser&quot; title=&quot;Login to create this missing page&quot;&gt;midgard_connection&lt;/span&gt; method &lt;strong&gt;open&lt;/strong&gt; takes one parameter.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;configuration name&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Configuration is read from system wide directory.
And depends on prefix defined for core. Usually &lt;code&gt;/etc&lt;/code&gt;, &lt;code&gt;/usr/local/etc&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Read about &lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_connection_method_open_config/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_connection method open_config&quot;&gt;open_config&lt;/a&gt; method if you need to create connection using user's defined configuration.&lt;/p&gt;

&lt;p&gt;Returns &lt;strong&gt;TRUE&lt;/strong&gt; if connection has been established for named configuration, &lt;strong&gt;FALSE&lt;/strong&gt; otherwise.&lt;/p&gt;

&lt;h2&gt;Example&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php

 try {
     $cnc = new midgard_connection();
 } catch (Exception $e) {
     echo $e-&amp;gt;getMessage();  
 }

 if(!$cnc-&amp;gt;open('midgard'))
     echo &quot;Could not connect with given configuration name&quot;;     
 ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
</description>
            <pubDate>Thu, 03 Apr 2008 19:59:15 +0000</pubDate>
        </item>
        <item>
            <title>PHP midgard_config</title>
            <link>http://www.midgard-project.org/documentation/php_midgard_config/</link>
            <description>&lt;div class=&quot;note&quot;&gt;
This part of API is forward compatible and it's recommended for Midgard 1.9/2.0. This is experimental section.
&lt;/div&gt;

&lt;p&gt;MidgardConfig ( &lt;strong&gt;midgard_config&lt;/strong&gt; ) class manages user defined ( system wide or personal ) and named configurations. It also has ability to create or update user's class' database tables.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;midgard_config&lt;/strong&gt; object represents &lt;strong&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/unified-configuration/&quot; class=&quot;wikipage &quot; title=&quot;unified configuration&quot;&gt;unified configuration&lt;/a&gt;&lt;/strong&gt;. 
This class is partially usable in Apache environment. All attempts to read, list or write configuration will throw warning. Usually generic one: &quot;Permission Denied&quot;.&lt;/p&gt;

&lt;p&gt;Minimum version: 1.9&lt;/p&gt;

&lt;h2&gt;Creating new midgard_config ( Constructor )&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;midgard_config&lt;/strong&gt; object is instantiated without arguments.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$config = new midgard_config();
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Midgard Config methods&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_config_method_read_file/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_config method read_file&quot;&gt;read_file&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_config_method_list_files/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_config method list_files&quot;&gt;list_files&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_config_method_save_file/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_config method save_file&quot;&gt;save_file&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_config_method_create_midgard_tables/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_config method create_midgard_tables&quot;&gt;create_midgard_tables&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_config_method_create_class_table/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_config method create_class_table&quot;&gt;create_class_table&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_config_method_update_class_table/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard_config method update_class_table&quot;&gt;update_class_table&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
            <pubDate>Thu, 03 Apr 2008 19:44:38 +0000</pubDate>
        </item>
        <item>
            <title>PHP midgard object method purge_attachments</title>
            <link>http://www.midgard-project.org/documentation/php_midgard_object_method_purge_attachments/</link>
            <description>&lt;p&gt;Purge object's attachments.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;boolean&lt;/em&gt; &lt;strong&gt;purge_attachments(&lt;em&gt;array&lt;/em&gt; args);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This method behaves exactly like &lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_object_method_delete_attachments/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard object method delete_attachments&quot;&gt;delete_attachments&lt;/a&gt; method.&lt;/p&gt;

&lt;p&gt;Important difference is that, there's &lt;strong&gt;no possibility&lt;/strong&gt; to undelete purged attachments.&lt;/p&gt;
</description>
            <pubDate>Fri, 28 Mar 2008 09:51:43 +0000</pubDate>
        </item>
        <item>
            <title>PHP midgard object method delete_attachments</title>
            <link>http://www.midgard-project.org/documentation/php_midgard_object_method_delete_attachments/</link>
            <description>&lt;p&gt;Delete object's attachments.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;boolean&lt;/em&gt; &lt;strong&gt;delete_attachments(&lt;em&gt;array&lt;/em&gt; args);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This method takes one argument:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;args, associative array&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Array's keys must be &lt;em&gt;midgard_attachment&lt;/em&gt; properties' names, values should define constraints  with properties's values.&lt;/p&gt;

&lt;p&gt;Delete all attachments with matching properties' values. It's possible to undelete attachment which have been deleted with this method.&lt;/p&gt;

&lt;p&gt;Returns &lt;em&gt;TRUE&lt;/em&gt; on success, &lt;em&gt;FALSE&lt;/em&gt; otherwise.&lt;/p&gt;

&lt;h2&gt;Example&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php

/* Delete all image attachments */

 try {
     $style = new midgard_style($guid);
 } catch (Exception $e) {
     echo $e-&amp;gt;getMessage();  
 }

 $args = array (&quot;mimetype&quot; =&amp;gt; &quot;image/jpeg&quot;);

 if($style-&amp;gt;delete_attachments($args))
     echo &quot;Deleted all image attachments&quot;;

 ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_object_attachments/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard object attachments&quot;&gt;midgard object attachments&lt;/a&gt;&lt;/p&gt;
</description>
            <pubDate>Fri, 28 Mar 2008 09:49:35 +0000</pubDate>
        </item>
        <item>
            <title>PHP midgard object method find_attachments</title>
            <link>http://www.midgard-project.org/documentation/php_midgard_object_method_find_attachments/</link>
            <description>&lt;p&gt;Find object's attachments.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;array&lt;/em&gt; &lt;strong&gt;find_attachments(&lt;em&gt;array&lt;/em&gt; args);&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This method takes one argument:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;args, associative array&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Array's keys must be &lt;em&gt;midgard_attachment&lt;/em&gt; properties' names, values should define constraints  with properties's values.&lt;/p&gt;

&lt;p&gt;Lists object's attachments and store them in returned array.&lt;/p&gt;

&lt;p&gt;Returns array with &lt;em&gt;midgard_attachment&lt;/em&gt; objects, or empty array if there are no parameters for object.&lt;/p&gt;

&lt;h2&gt;Example&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;?php

/* Find all image attachments */

 try {
     $style = new midgard_style($guid);
 } catch (Exception $e) {
     echo $e-&amp;gt;getMessage();  
 }

 $args = array (&quot;mimetype&quot; =&amp;gt; &quot;image/jpeg&quot;);

 $atts = $style-&amp;gt;find_atachments($args);

 if(!empty($atts)) {

     foreach($atts as $obj) {

           echo $obj-&amp;gt;name;
     }

 } else {

      echo &quot;Didn't find any object's attachments&quot;;

 } 

 ?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href=&quot;http://www.midgard-project.org/documentation/php_midgard_object_attachments/&quot; class=&quot;wikipage default&quot; title=&quot;PHP midgard object attachments&quot;&gt;midgard object atachments&lt;/a&gt;&lt;/p&gt;
</description>
            <pubDate>Fri, 28 Mar 2008 09:40:38 +0000</pubDate>
        </item>
    </channel>
</rss>
