コード例 #1
0
ファイル: Tables.php プロジェクト: redmexico/XoopsCore
 /**
  * Load table schema from database, or starts new empty schema if
  * table does not exist
  *
  * @param string $table table
  *
  * @return bool true if no errors, false if errors encountered
  */
 public function addTable($table)
 {
     if (isset($this->tables[$table])) {
         return true;
     }
     $tableDef = $this->getTable($table);
     if (is_array($tableDef)) {
         $this->tables[$table] = $tableDef;
         return true;
     } else {
         if ($tableDef === true) {
             $tableDef = array('name' => $this->db->prefix($table), 'options' => 'ENGINE=InnoDB');
             $tableDef['create'] = true;
             $this->tables[$table] = $tableDef;
             $this->queue[] = array('createtable' => $table);
             return true;
         } else {
             return false;
         }
     }
 }
コード例 #2
0
ファイル: QueryBuilder.php プロジェクト: ming-hai/XoopsCore
 /**
  * Creates and adds a right join to the query.
  *
  * <code>
  *     $qb = $conn->createQueryBuilder()
  *         ->select('u.name')
  *         ->from('users', 'u')
  *         ->rightJoin('u', 'phonenumbers', 'p', 'p.is_primary = 1');
  * </code>
  *
  * @param string $fromAlias The alias that points to a from clause
  * @param string $join      The table name to join. Adds table prefix to table.
  * @param string $alias     The alias of the join table
  * @param string $condition The condition for the join
  *
  * @return QueryBuilder This QueryBuilder instance.
  */
 public function rightJoinPrefix($fromAlias, $join, $alias, $condition = null)
 {
     $join = Connection::prefix($join);
     return $this->rightJoin($fromAlias, $join, $alias, $condition);
 }