Exemplo n.º 1
0
 /**
  * @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);
 }
Exemplo n.º 2
0
 public function testContains()
 {
     $this->assertEquals(true, \LouisLam\LouisString::contains("Hello World", "Hello"));
 }