Beispiel #1
0
 /**
  * Obtains the metadata for the named table.
  * @param string table name
  * @return TDbTableSchema table metadata. Null if the named table does not exist.
  */
 public function getTable($name)
 {
     if (isset($this->_tables[$name])) {
         return $this->_tables[$name];
     } else {
         if (!isset($this->_cacheExclude[$name]) && ($duration = $this->_connection->schemaCachingDuration) > 0 && ($cache = prado::getApplication()->getCache()) !== null) {
             $key = 'prado:dbschema' . $this->_connection->connectionString . ':' . $this->_connection->username . ':' . $name;
             if (($table = $cache->get($key)) === false) {
                 $table = $this->createTable($name);
                 $cache->set($key, $table, $duration);
             }
             return $this->_tables[$name] = $table;
         } else {
             return $this->_tables[$name] = $this->createTable($name);
         }
     }
 }
Beispiel #2
0
 /**
  * GetDroppedControl
  *
  * Compatibility method to get the dropped control
  * @return TControl dropped control, or null if not found
  */
 public function getDroppedControl()
 {
     $control = null;
     $service = prado::getApplication()->getService();
     if ($service instanceof TPageService) {
         // Find the control
         // Warning, this will not work if you have a '_' in your control Id !
         $dropControlId = str_replace(TControl::CLIENT_ID_SEPARATOR, TControl::ID_SEPARATOR, $this->_dragElementId);
         $control = $service->getRequestedPage()->findControl($dropControlId);
     }
     return $control;
 }