Exemplo n.º 1
0
 /**
  * Connects to the database and defines the schema associated with
  * $this->Name. Also instantiates and automatically defines
  * $this->Validation.
  *
  */
 public function DefineSchema()
 {
     if (!isset($this->Schema)) {
         $this->Schema = new Gdn_Schema($this->Name, $this->Database);
         $this->PrimaryKey = $this->Schema->PrimaryKey($this->Name, $this->Database);
         if (is_array($this->PrimaryKey)) {
             //print_r($this->PrimaryKey);
             $this->PrimaryKey = $this->PrimaryKey[0];
         }
         $this->Validation->ApplyRulesBySchema($this->Schema);
     }
 }