Esempio n. 1
0
 function getObjects($criteria = null, $id_as_key = false, $as_object = true, $debug = false, $language = false)
 {
     // Create the first part of the SQL query to join the "_text" table
     $sql = 'SELECT * FROM ' . $this->table . ' AS ' . $this->_itemname . ' INNER JOIN ' . $this->table . '_text AS ' . $this->_itemname . '_text ON ' . $this->_itemname . '.' . $this->keyName . '=' . $this->_itemname . '_text.' . $this->keyName;
     if ($language) {
         // If a language was specified, then let's create a WHERE clause to only return the objects associated with this language
         // if no criteria was previously created, let's create it
         if (!$criteria) {
             $criteria = new CriteriaCompo();
         }
         $criteria->add(new Criteria('language', $language));
         return parent::getObjects($criteria, $id_as_key, $as_object, $debug, $sql);
     }
     return parent::getObjects($criteria, $id_as_key, $as_object, $debug, $sql);
 }