/** * @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; }
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; }
/** * @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(); }
public function setId($id) { $attr = new \Variable\Attribute($id); $this->id = $attr->get(); }
/** * 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(); }
/** * 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(); }