本文整理汇总了PHP中Field::setName方法的典型用法代码示例。如果您正苦于以下问题:PHP Field::setName方法的具体用法?PHP Field::setName怎么用?PHP Field::setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Field
的用法示例。
在下文中一共展示了Field::setName方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setName
public function setName($name)
{
parent::setName($name);
$this->mainSelectionList->setId($name . "_main");
$this->subSelectionList->setName($name);
return $this;
}
示例2: _parseFields
private function _parseFields($results)
{
$response = array();
foreach ($results as $result) {
$field = new Field();
$field->setName($result["Field"]);
$field->setType($result["Type"]);
$field->setPk($result["Key"] == 'PRI');
$response[] = $field;
}
return $response;
}
示例3: _parseFields
private function _parseFields($results, $pk)
{
$response = array();
foreach ($results as $result) {
$field = new Field();
$field->setName($result["field"]);
$field->setType($result["type"]);
$field->setPk($result["field"] == $pk["col"]);
$response[] = $field;
}
return $response;
}
示例4: getTableFields
/**
* Generate random table fields to test
**/
private function getTableFields()
{
require_once APPPATH . "libraries/scaffolder/drivers/field.php";
$id = new Field();
$id->setName("id");
$id->setPk(true);
$nome = new Field();
$nome->setName("nome");
$alias = new Field();
$alias->setName("alias");
$estado = new Field();
$estado->setName("estado_id");
return array($id, $nome, $alias, $estado);
}
示例5: Field
/**
* Get a field, creating it if necessary.
* @param $fieldName string
* @param $schemaPlugin string
* @return object Field
*/
function &buildField($fieldName, $schemaPluginName)
{
$field =& $this->getFieldByName($fieldName, $schemaPluginName);
if (!$field) {
$schemaDao = DAORegistry::getDAO('SchemaDAO');
$schema =& $schemaDao->buildSchema($schemaPluginName);
$field = new Field();
$field->setName($fieldName);
$field->setSchemaId($schema->getSchemaId());
$plugin =& $field->getSchemaPlugin();
if (!$plugin) {
fatalError('Unknown schema plugin "' . $schemaPlugin . '"!');
}
if (!in_array($fieldName, $plugin->getFieldList())) {
// This field doesn't actually exist -- return null.
unset($field);
$field = null;
return $field;
}
$this->insertField($field);
}
return $field;
}
示例6: isField
/**
*
* @param array $rows
* @param integer $index
*/
public static function isField($rows, $index)
{
if (strstr($rows[$index], "@var")) {
$field = new Field(self::removeComments($rows[$index], "@var"));
$index++;
while (!strstr($rows[$index], "*/")) {
$row = $rows[$index];
foreach (self::$types as $type => $method) {
if (strstr($row, $type)) {
$field->{$method}(self::removeComments($row, $type));
}
}
$index++;
}
$field->setName(trim(str_replace("protected \$", "", str_replace(";", "", $rows[$index + 1]))));
return $field;
} else {
return false;
}
}
示例7: setName
/**
* Sets name for fields, applies mask to dbName creation
* @param string $name
*/
public function setName($name)
{
parent::setName($name);
$this->dbName = null;
}
示例8: field
/**
* @param $name
* @return Field
*/
public function field($name)
{
$field = new Field();
$field->setName($name)->setGroup($this->group);
$this->setField($field);
return $field;
}
示例9: setFields
public function setFields(Field $field)
{
$this->addItem($field->setName(self::FIELD_KEY));
return $this;
}
示例10: createValidation
/**
* Descricao : Metodo responsavel por mapear os nodos fields de cada acao.
* Este metodo retorna um array de objetos fields que serao validados posteriormente.
*
* @param Um nodo <field>
* @return Um array de objetos Field
*/
private function createValidation($node)
{
$fieldArray = array();
if ($node->hasChildNodes()) {
$fields = $node->childNodes;
foreach ($fields as $field) {
$fieldObject = new Field();
if ($field->nodeName == "field") {
if ($field->hasAttribute("name")) {
$name = $field->getAttribute("name");
$fieldObject->setName($name);
}
if ($field->hasAttribute("method")) {
$method = $field->getAttribute("method");
$fieldObject->setMethod($method);
}
if ($field->hasAttribute("validationType")) {
$validationType = $field->getAttribute("validationType");
$fieldObject->setValidationType($validationType);
}
$fieldArray[] = $fieldObject;
}
}
}
return $fieldArray;
}