setDefaultProperties() 공개 메소드

Sets default values for new entities
public setDefaultProperties ( array $defaultProperties )
$defaultProperties array Default values for new entities
예제 #1
0
파일: Farm.php 프로젝트: scalr/scalr
 /**
  * Reset farm id on clone
  */
 public function __clone()
 {
     if (empty($this->_settings)) {
         $this->settings->load();
     }
     $unref = null;
     $this->id =& $unref;
     $this->_settings = clone $this->_settings;
     $this->_settings->setCriteria([['farmId' => &$this->id]]);
     $this->_settings->setDefaultProperties(['farmId' => &$this->id]);
 }
예제 #2
0
 /**
  * Reset cloud credentials id on clone
  */
 public function __clone()
 {
     $this->_properties = clone $this->properties;
     $unref = null;
     $this->id =& $unref;
     $this->name = "{$this->envId}-{$this->accountId}-{$this->cloud}-" . \Scalr::GenerateUID(true);
     $this->_properties->setCriteria([['cloudCredentialsId' => &$this->id]]);
     $this->_properties->setDefaultProperties(['cloudCredentialsId' => &$this->id]);
 }
예제 #3
0
 /**
  * Reset cloud credentials id on clone
  */
 public function __clone()
 {
     $unref = null;
     $this->id =& $unref;
     if (isset($this->_properties)) {
         $this->_properties = clone $this->_properties;
         $this->_properties->setCriteria([['cloudCredentialsId' => &$this->id]]);
         $this->_properties->setDefaultProperties(['cloudCredentialsId' => &$this->id]);
     }
 }