Beispiel #1
0
 public function findAll($type, $from, $count)
 {
     $record = DatabaseRecordFactory::factory()->createObject($type);
     $query = "SELECT * FROM " . $record->getTable()->getName();
     // . " LIMIT (" . $from . "," . $count . ")";
     $records = array();
     $stmt = new DatabaseStatement($this->connection, $query);
     $stmt->exec();
     if ($stmt->hasResult()) {
         while ($row = $stmt->fetchAssocNextRow()) {
             $record = DatabaseRecordFactory::factory()->createObject($type);
             foreach ($row as $field => $value) {
                 $record->__set($field, $value);
             }
             $records[] = $record;
         }
     }
     return $records;
 }
Beispiel #2
0
 public function validateResourceType($type)
 {
     return DatabaseRecordFactory::factory()->createObject($type) != false;
 }