Esempio n. 1
0
 /**
  * Initializes this model.
  * This method is invoked when an ECassandraCF is newly created.
  * You should override this method to provide code that is needed to initialize the model.
  * For example, to specify a column family:
  * <pre>
  * 
  * </pre>
  */
 public function init()
 {
     if (empty($this->_cfName)) {
         $this->_cfName = $this->tableName();
         if (self::$_connectionPool === null) {
             self::$_connectionPool = Yii::app()->getComponent('cassandradb')->getConnectionPool();
         }
         if (strpos($this->_cfName, '{{') !== false) {
             $this->_cfName = str_replace('{{', '', $this->_cfName);
             $this->_cfName = str_replace('}}', '', $this->_cfName);
             $this->_cfName = Yii::app()->getComponent('cassandradb')->tablePrefix . $this->_cfName;
         }
     }
     if (!empty($this->_cfName) && !is_object($this->_columnFamily)) {
         $this->_columnFamily = new ColumnFamily(self::$_connectionPool, $this->_cfName);
     }
     //parent::init();
 }