コード例 #1
0
ファイル: Table.php プロジェクト: HaldunA/phpwebsite
    /**
     * @see parent::getSchemaQuery()
     * @param string $column_name Name of specific column
     * @return string
     */
    public function getSchemaQuery($column_name = null)
    {
        $sql_query = 'SELECT information_schema.columns.* FROM information_schema.columns
WHERE information_schema.columns.table_name = \'' . $this->getFullName(false) . '\' AND information_schema.columns.table_catalog = \'' . $this->db->getDatabaseName() . '\'';
        if (isset($column_name)) {
            $column = new \Variable\Attribute($column_name);
            $sql_query .= ' AND information_schema.columns.column_name=\'' . $column->get() . '\'';
        }
        return $sql_query;
    }
コード例 #2
0
ファイル: PackageManager.php プロジェクト: HaldunA/phpwebsite
 public static function loadPackage($module)
 {
     $moduleObj = new \Variable\Attribute($module);
     $file_path = 'Module/' . $moduleObj->get() . '/Setup/Package.php';
     $class_name = $moduleObj->get() . '\\Setup\\Package';
     if (!is_file($file_path)) {
         throw new \Exception(t('Package file does not exist for module "%s"', $module));
     }
     require_once $file_path;
     $package = new $class_name();
     return $package;
 }
コード例 #3
0
ファイル: Column.php プロジェクト: HaldunA/phpwebsite
 /**
  * @return string Name of column
  */
 public function getName($with_delimiter = false)
 {
     return $with_delimiter ? wrap($this->name->get(), $this->resource->db->getDelimiter()) : $this->name->get();
 }
コード例 #4
0
ファイル: Pager.php プロジェクト: par-orillonsoft/phpwebsite
 public function setId($id)
 {
     $attr = new \Variable\Attribute($id);
     $this->id = $attr->get();
 }
コード例 #5
0
ファイル: Variable.php プロジェクト: HaldunA/phpwebsite
 /**
  * Sets the database column type
  * @param string $col_type
  */
 public function setColumnType($col_type)
 {
     $col = new \Variable\Attribute($col_type, 'column_type');
     $this->column_type = $col->__toString();
 }
コード例 #6
0
ファイル: Tag.php プロジェクト: HaldunA/phpwebsite
 /**
  * Adds a data attribute to the tag:
  * Example:
  * <code>
  * $tag = new Tag('p', 'hello');
  * $tag->addData('foo-bar', 1);
  * var_dump($tag->__toString());
  * // echoes <p data-foo-bar="1">hello</p>
  * </code>
  * @param string $name
  * @param string $value
  */
 public function addData($name, $value)
 {
     if (is_numeric($value)) {
         $value = (string) $value;
     }
     $oName = new \Variable\Attribute($name, 'dataNameAttribute');
     $oValue = new \Variable\String($value, 'dataValueAttribute');
     $this->data[$oName->get()] = $oValue->get();
 }