Esempio n. 1
0
 /**
  * Implement this by setting $obj values (e.g. $obj->setId($row->Id) from a DB row
  * @param GD_Model_Server $obj
  * @param Zend_Db_Table_Row_Abstract $row
  */
 protected function populateObjectFromRow(&$obj, Zend_Db_Table_Row_Abstract $row)
 {
     $crypt = new GD_Crypt();
     $decrypted_pwd = $crypt->doDecrypt($row->password);
     $obj->setId($row->id)->setName($row->name)->setHostname($row->hostname)->setConnectionTypesId($row->connection_types_id)->setPort($row->port)->setUsername($row->username)->setPassword($decrypted_pwd)->setRemotePath($row->remote_path)->setProjectsId($row->projects_id);
     $ct_map = new GD_Model_ConnectionTypesMapper();
     $connection_type = new GD_Model_ConnectionType();
     $ct_map->populateObjectFromRow($connection_type, $row->findParentRow('GD_Model_DbTable_ConnectionTypes'));
     $obj->setConnectionType($connection_type);
 }
Esempio n. 2
0
 public function __construct(GD_Model_Server $server)
 {
     $this->_hostname = $server->getHostname();
     $this->_username = $server->getUsername();
     $this->_password = $server->getPassword();
     $this->_port = $server->getPort() ? $server->getPort() : 21;
     $this->_remote_path = $server->getRemotePath();
 }
Esempio n. 3
0
 /**
  * Generate a new GD_Ftp instance based on a GD_Model_Server object
  *
  * @param GD_Model_Server $server
  * @return GD_Ftp
  */
 public static function FromServer(GD_Model_Server $server)
 {
     return new GD_Ftp($server->getHostname(), $server->getUsername(), $server->getPassword(), $server->getRemotePath(), $server->getPort() ? $server->getPort() : 21);
 }