Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Set the _Exists property if the table exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelchisari authored and The Appleseed Project committed Dec 9, 2010
1 parent ad69a48 commit 0e9ec1f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions system/model.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class cModel extends cBase {

protected $_Within = false;

protected $_Exists = false;

protected $_PrimaryKey;
protected $_ForeignKeys;

Expand Down Expand Up @@ -59,11 +61,14 @@ public function __construct ( $pTable = null ) {
$this->_Tablename = $tablename;

// Pull the table structure into the class.
$this->Structure ();
if ( $this->Structure () )
$this->_Exists = true;

$this->_Protected = array ();

parent::__construct();

return ( true );
}

public function Structure ( $pTablename = null) {
Expand All @@ -72,7 +77,7 @@ public function Structure ( $pTablename = null) {

if ( !$pTablename ) $pTablename = $this->_Tablename;

$fieldinfo = $Database->GetFieldInformation ( $pTablename );
if ( !$fieldinfo = $Database->GetFieldInformation ( $pTablename ) ) return ( false );

foreach ( $fieldinfo as $f => $field ) {
$fieldname = $field['Field'];
Expand Down

0 comments on commit 0e9ec1f

Please sign in to comment.