public function testDisplayName() { $this->assertEquals("User id", Util::displayName("user_id")); }
public function getTableDisplayName($routeName = null) { if (isset($this->tableDisplayName[$routeName]) && $this->tableDisplayName[$routeName] != null) { return $this->tableDisplayName[$routeName]; } else { return Util::displayName($routeName); } }
/** * @param LouisCRUD $crud * @param string $name * @param string $dataType */ public function __construct($crud, $name, $dataType) { $this->crud = $crud; $this->name = $name; $this->displayName = Util::displayName($name); $this->dataType = $dataType; if (LouisString::contains($dataType, "varchar")) { $this->fieldType = new TextField(); } else { if (LouisString::contains($dataType, "int")) { $this->fieldType = new IntegerType(); } else { if (LouisString::contains($dataType, "text")) { $this->fieldType = new TextArea(); } else { $this->fieldType = new TextField(); } } } $this->fieldType->setField($this); }