/** * Column constructor (extends cassandra_Column) * @param string $name Column name * @param PandraColumnContainer $parentCF parent column family (standard or super), or supercolumn * @param array $typeDef validator type definitions */ public function __construct($name, $parentCF = NULL, $typeDef = array()) { parent::__construct(array('name' => $name)); if ($parentCF instanceof PandraColumnContainer) { $this->setParentCF($parentCF); } $this->typeDef = $typeDef; }
public function __construct($vals = null) { if (!isset(self::$_TSPEC)) { self::$_TSPEC = array(1 => array('var' => 'name', 'type' => TType::STRING), 2 => array('var' => 'value', 'type' => TType::STRING), 3 => array('var' => 'timestamp', 'type' => TType::I64), 4 => array('var' => 'ttl', 'type' => TType::I32)); } if (is_array($vals)) { parent::__construct(self::$_TSPEC, $vals); } }
/** * Column constructor (extends cassandra_Column) * @param string $name Column name * @param PandraColumnContainer $parent parent column family (standard or super), or supercolumn * @param array $typeDef validator type definitions */ public function __construct($name, $typeDefs = array(), PandraColumnContainer $parent = NULL, $callback = NULL) { parent::__construct(array('name' => $name)); if ($parent !== NULL) { $this->setParent($parent, !$parent->columnIn($name)); } if ($callback !== NULL) { $this->setCallback($callback); } $this->setTypeDef($typeDefs); }
public function read($input) { $xfer = 0; $fname = null; $ftype = 0; $fid = 0; $xfer += $input->readStructBegin($fname); while (true) { $xfer += $input->readFieldBegin($fname, $ftype, $fid); if ($ftype == TType::STOP) { break; } switch ($fid) { case 1: if ($ftype == TType::STRING) { $xfer += $input->readString($this->name); } else { $xfer += $input->skip($ftype); } break; case 2: if ($ftype == TType::LST) { $this->columns = array(); $_size0 = 0; $_etype3 = 0; $xfer += $input->readListBegin($_etype3, $_size0); for ($_i4 = 0; $_i4 < $_size0; ++$_i4) { $elem5 = null; $elem5 = new cassandra_Column(); $xfer += $elem5->read($input); $this->columns[] = $elem5; } $xfer += $input->readListEnd(); } else { $xfer += $input->skip($ftype); } break; default: $xfer += $input->skip($ftype); break; } $xfer += $input->readFieldEnd(); } $xfer += $input->readStructEnd(); return $xfer; }