private function Initialize()
    {
        if (!$this->initialized)
        {
            $schema = $this->GetSchema();
            $t = $schema->Table();
            $sql = $schema->SqlBuilder();
           
            $what = $t->ToSelectList();
            $where = $sql->Equals($t->Field($schema->KeyField()), $sql->Value($this->KeyValue()));
            $select = $sql->Select(false, $what, $t, $where);
            $reader = $schema->Connection()->ExecuteQuery((string)$select);
            if ($reader->Read())
                $this->InitFromReader($reader);

            $reader->Close();
        }
    }
private function Initialize()
    {
        if (!$this->initialized)
        {
            $schema = $this->GetSchema();
            $t = $schema->Table();
            $sql = $schema->SqlBuilder();
           
            $what = $t->ToSelectList();
            $where = $sql->Equals($t->Field($schema->KeyField()), $sql->Value($this->KeyValue()));
            $select = $sql->Select(false, $what, $t, $where);
            $reader = $schema->Connection()->ExecuteQuery((string)$select);
            if ($reader->Read())
                $this->InitFromReader($reader);

            $reader->Close();
        }
    }
private function Initialize ( ) { if ( ! $ this -> initialized ) { $ schema = $ this -> GetSchema ( ) ; $ t = $ schema -> Table ( ) ; $ sql = $ schema -> SqlBuilder ( ) ; $ what = $ t -> ToSelectList ( ) ; $ where = $ sql -> Equals ( $ t -> Field ( $ schema -> KeyField ( ) ) , $ sql -> Value ( $ this -> KeyValue ( ) ) ) ; $ select = $ sql -> Select ( false , $ what , $ t , $ where ) ; $ reader = $ schema -> Connection ( ) -> ExecuteQuery ( ( string ) $ select ) ; if ( $ reader -> Read ( ) ) $ this -> InitFromReader ( $ reader ) ; $ reader -> Close ( ) ; } }
Fetches data to fill fields.
Fetches data to fill fields .