本文整理汇总了PHP中UUID::import方法的典型用法代码示例。如果您正苦于以下问题:PHP UUID::import方法的具体用法?PHP UUID::import怎么用?PHP UUID::import使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UUID
的用法示例。
在下文中一共展示了UUID::import方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remover
/**
* @param mixed $id
* @return WeLearn_DTO_IDTO
*/
public function remover($id)
{
$UUID = UUID::import($id);
$respostaRemovida = $this->recuperar($id);
$this->_cf->remove($UUID->bytes);
$respostaRemovida->setPersistido(false);
return $respostaRemovida;
}
示例2: recuperarQtdTotalAtivas
/**
* @param WeLearn_Cursos_Curso $curso
* @return int
*/
public function recuperarQtdTotalAtivas(WeLearn_Cursos_Curso $curso)
{
try {
$modulos = $this->_moduloDao->recuperarTodosPorCurso($curso);
$qtdTotal = 0;
foreach ($modulos as $modulo) {
try {
$column = $this->_cf->get(UUID::import($modulo->getId())->bytes);
if ((int) $column['qtdQuestoesExibir'] > 0) {
$qtdTotal++;
}
} catch (cassandra_NotFoundException $e) {
}
}
return $qtdTotal;
} catch (cassandra_NotFoundException $e) {
return 0;
}
}
示例3: setUp
public function setUp()
{
$this->client = new Connection('Keyspace1');
$this->cf_long = new ColumnFamily($this->client, 'StdLong');
$this->cf_int = new ColumnFamily($this->client, 'StdInteger');
$this->cf_time = new ColumnFamily($this->client, 'StdTimeUUID');
$this->cf_lex = new ColumnFamily($this->client, 'StdLexicalUUID');
$this->cf_ascii = new ColumnFamily($this->client, 'StdAscii');
$this->cf_utf8 = new ColumnFamily($this->client, 'StdUTF8');
$this->cf_suplong = new ColumnFamily($this->client, 'SuperLong');
$this->cf_supint = new ColumnFamily($this->client, 'SuperInt');
$this->cf_suptime = new ColumnFamily($this->client, 'SuperTime');
$this->cf_suplex = new ColumnFamily($this->client, 'SuperLex');
$this->cf_supascii = new ColumnFamily($this->client, 'SuperAscii');
$this->cf_suputf8 = new ColumnFamily($this->client, 'SuperUTF8');
$this->cf_suplong_sublong = new ColumnFamily($this->client, 'SuperLongSubLong');
$this->cf_suplong_subint = new ColumnFamily($this->client, 'SuperLongSubInt');
$this->cf_suplong_subtime = new ColumnFamily($this->client, 'SuperLongSubTime');
$this->cf_suplong_sublex = new ColumnFamily($this->client, 'SuperLongSubLex');
$this->cf_suplong_subascii = new ColumnFamily($this->client, 'SuperLongSubAscii');
$this->cf_suplong_subutf8 = new ColumnFamily($this->client, 'SuperLongSubUTF8');
$this->cf_valid_long = new ColumnFamily($this->client, 'ValidatorLong');
$this->cf_valid_int = new ColumnFamily($this->client, 'ValidatorInt');
$this->cf_valid_time = new ColumnFamily($this->client, 'ValidatorTime');
$this->cf_valid_lex = new ColumnFamily($this->client, 'ValidatorLex');
$this->cf_valid_ascii = new ColumnFamily($this->client, 'ValidatorAscii');
$this->cf_valid_utf8 = new ColumnFamily($this->client, 'ValidatorUTF8');
$this->cf_valid_bytes = new ColumnFamily($this->client, 'ValidatorBytes');
$this->cf_def_valid = new ColumnFamily($this->client, 'DefaultValidator');
$this->cfs = array($this->cf_long, $this->cf_int, $this->cf_ascii, $this->cf_time, $this->cf_lex, $this->cf_utf8, $this->cf_suplong, $this->cf_supint, $this->cf_suptime, $this->cf_suplex, $this->cf_supascii, $this->cf_suputf8, $this->cf_suplong_sublong, $this->cf_suplong_subint, $this->cf_suplong_subtime, $this->cf_suplong_sublex, $this->cf_suplong_subascii, $this->cf_suplong_subutf8, $this->cf_valid_long, $this->cf_valid_int, $this->cf_valid_time, $this->cf_valid_lex, $this->cf_valid_ascii, $this->cf_valid_utf8, $this->cf_valid_bytes, $this->cf_def_valid);
$this->TIME1 = CassandraUtil::uuid1();
$this->TIME2 = CassandraUtil::uuid1();
$this->TIME3 = CassandraUtil::uuid1();
$this->LEX1 = UUID::import('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')->bytes;
$this->LEX2 = UUID::import('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb')->bytes;
$this->LEX3 = UUID::import('cccccccccccccccccccccccccccccccc')->bytes;
}
示例4: atualizarPosicoes
/**
* @param WeLearn_Cursos_Conteudo_Aula $aula
* @param array $novasPosicoes
*/
public function atualizarPosicoes(WeLearn_Cursos_Conteudo_Aula $aula, array $novasPosicoes)
{
$posicoes = array();
$rows = array();
foreach ($novasPosicoes as $posicao => $id) {
$UUID = UUID::import($id)->bytes;
$posicoes[$posicao] = $UUID;
$rows[$UUID] = array('nroOrdem' => $posicao);
}
$aulaUUID = UUID::import($aula->getId())->bytes;
$this->_cf->batch_insert($rows);
$this->_paginaPorAulaCF->remove($aulaUUID);
$this->_paginaPorAulaCF->insert($aulaUUID, $posicoes);
}
示例5: _adicionar
/**
* @param WeLearn_DTO_IDTO $dto
* @return boolean
*/
protected function _adicionar(WeLearn_DTO_IDTO &$dto)
{
$paginaUUID = UUID::import($dto->getPagina()->getId());
$this->_cf->insert($paginaUUID->bytes, $dto->toCassandra());
$dto->setPersistido(true);
}
示例6: __construct
//.........这里部分代码省略.........
foreach ($ksdefs as $ksdef) {
$exists = $exists || $ksdef->name == self::$KS;
}
if ($exists) {
$this->sys->drop_keyspace(self::$KS);
}
$this->sys->create_keyspace(self::$KS, array());
$cfattrs = array("comparator_type" => DataType::LONG_TYPE);
$this->sys->create_column_family(self::$KS, 'StdLong', $cfattrs);
$cfattrs = array("comparator_type" => DataType::INTEGER_TYPE);
$this->sys->create_column_family(self::$KS, 'StdInteger', $cfattrs);
$cfattrs = array("comparator_type" => DataType::TIME_UUID_TYPE);
$this->sys->create_column_family(self::$KS, 'StdTimeUUID', $cfattrs);
$cfattrs = array("comparator_type" => DataType::LEXICAL_UUID_TYPE);
$this->sys->create_column_family(self::$KS, 'StdLexicalUUID', $cfattrs);
$cfattrs = array("comparator_type" => DataType::ASCII_TYPE);
$this->sys->create_column_family(self::$KS, 'StdAscii', $cfattrs);
$cfattrs = array("comparator_type" => DataType::UTF8_TYPE);
$this->sys->create_column_family(self::$KS, 'StdUTF8', $cfattrs);
$cfattrs = array("column_type" => "Super");
$cfattrs["comparator_type"] = DataType::LONG_TYPE;
$this->sys->create_column_family(self::$KS, 'SuperLong', $cfattrs);
$cfattrs["comparator_type"] = DataType::INTEGER_TYPE;
$this->sys->create_column_family(self::$KS, 'SuperInt', $cfattrs);
$cfattrs["comparator_type"] = DataType::TIME_UUID_TYPE;
$this->sys->create_column_family(self::$KS, 'SuperTime', $cfattrs);
$cfattrs["comparator_type"] = DataType::LEXICAL_UUID_TYPE;
$this->sys->create_column_family(self::$KS, 'SuperLex', $cfattrs);
$cfattrs["comparator_type"] = DataType::ASCII_TYPE;
$this->sys->create_column_family(self::$KS, 'SuperAscii', $cfattrs);
$cfattrs["comparator_type"] = DataType::UTF8_TYPE;
$this->sys->create_column_family(self::$KS, 'SuperUTF8', $cfattrs);
$cfattrs = array("column_type" => "Super", "comparator_type" => DataType::LONG_TYPE);
$cfattrs["subcomparator_type"] = DataType::LONG_TYPE;
$this->sys->create_column_family(self::$KS, 'SuperLongSubLong', $cfattrs);
$cfattrs["subcomparator_type"] = DataType::INTEGER_TYPE;
$this->sys->create_column_family(self::$KS, 'SuperLongSubInt', $cfattrs);
$cfattrs["subcomparator_type"] = DataType::TIME_UUID_TYPE;
$this->sys->create_column_family(self::$KS, 'SuperLongSubTime', $cfattrs);
$cfattrs["subcomparator_type"] = DataType::LEXICAL_UUID_TYPE;
$this->sys->create_column_family(self::$KS, 'SuperLongSubLex', $cfattrs);
$cfattrs["subcomparator_type"] = DataType::ASCII_TYPE;
$this->sys->create_column_family(self::$KS, 'SuperLongSubAscii', $cfattrs);
$cfattrs["subcomparator_type"] = DataType::UTF8_TYPE;
$this->sys->create_column_family(self::$KS, 'SuperLongSubUTF8', $cfattrs);
$cfattrs = array("column_type" => "Standard");
$cfattrs["default_validation_class"] = DataType::LONG_TYPE;
$this->sys->create_column_family(self::$KS, 'ValidatorLong', $cfattrs);
$cfattrs["default_validation_class"] = DataType::INTEGER_TYPE;
$this->sys->create_column_family(self::$KS, 'ValidatorInt', $cfattrs);
$cfattrs["default_validation_class"] = DataType::TIME_UUID_TYPE;
$this->sys->create_column_family(self::$KS, 'ValidatorTime', $cfattrs);
$cfattrs["default_validation_class"] = DataType::LEXICAL_UUID_TYPE;
$this->sys->create_column_family(self::$KS, 'ValidatorLex', $cfattrs);
$cfattrs["default_validation_class"] = DataType::ASCII_TYPE;
$this->sys->create_column_family(self::$KS, 'ValidatorAscii', $cfattrs);
$cfattrs["default_validation_class"] = DataType::UTF8_TYPE;
$this->sys->create_column_family(self::$KS, 'ValidatorUTF8', $cfattrs);
$cfattrs["default_validation_class"] = DataType::BYTES_TYPE;
$this->sys->create_column_family(self::$KS, 'ValidatorBytes', $cfattrs);
$cfattrs["default_validation_class"] = DataType::LONG_TYPE;
$this->sys->create_column_family(self::$KS, 'DefaultValidator', $cfattrs);
// Quick way to create a TimeUUIDType validator to subcol
$this->sys->create_index(self::$KS, 'DefaultValidator', 'subcol', DataType::TIME_UUID_TYPE, NULL, NULL);
$this->client = new ConnectionPool(self::$KS);
$this->cf_long = new ColumnFamily($this->client, 'StdLong');
$this->cf_int = new ColumnFamily($this->client, 'StdInteger');
$this->cf_time = new ColumnFamily($this->client, 'StdTimeUUID');
$this->cf_lex = new ColumnFamily($this->client, 'StdLexicalUUID');
$this->cf_ascii = new ColumnFamily($this->client, 'StdAscii');
$this->cf_utf8 = new ColumnFamily($this->client, 'StdUTF8');
$this->cf_suplong = new ColumnFamily($this->client, 'SuperLong');
$this->cf_supint = new ColumnFamily($this->client, 'SuperInt');
$this->cf_suptime = new ColumnFamily($this->client, 'SuperTime');
$this->cf_suplex = new ColumnFamily($this->client, 'SuperLex');
$this->cf_supascii = new ColumnFamily($this->client, 'SuperAscii');
$this->cf_suputf8 = new ColumnFamily($this->client, 'SuperUTF8');
$this->cf_suplong_sublong = new ColumnFamily($this->client, 'SuperLongSubLong');
$this->cf_suplong_subint = new ColumnFamily($this->client, 'SuperLongSubInt');
$this->cf_suplong_subtime = new ColumnFamily($this->client, 'SuperLongSubTime');
$this->cf_suplong_sublex = new ColumnFamily($this->client, 'SuperLongSubLex');
$this->cf_suplong_subascii = new ColumnFamily($this->client, 'SuperLongSubAscii');
$this->cf_suplong_subutf8 = new ColumnFamily($this->client, 'SuperLongSubUTF8');
$this->cf_valid_long = new ColumnFamily($this->client, 'ValidatorLong');
$this->cf_valid_int = new ColumnFamily($this->client, 'ValidatorInt');
$this->cf_valid_time = new ColumnFamily($this->client, 'ValidatorTime');
$this->cf_valid_lex = new ColumnFamily($this->client, 'ValidatorLex');
$this->cf_valid_ascii = new ColumnFamily($this->client, 'ValidatorAscii');
$this->cf_valid_utf8 = new ColumnFamily($this->client, 'ValidatorUTF8');
$this->cf_valid_bytes = new ColumnFamily($this->client, 'ValidatorBytes');
$this->cf_def_valid = new ColumnFamily($this->client, 'DefaultValidator');
$this->cfs = array($this->cf_long, $this->cf_int, $this->cf_ascii, $this->cf_time, $this->cf_lex, $this->cf_utf8, $this->cf_suplong, $this->cf_supint, $this->cf_suptime, $this->cf_suplex, $this->cf_supascii, $this->cf_suputf8, $this->cf_suplong_sublong, $this->cf_suplong_subint, $this->cf_suplong_subtime, $this->cf_suplong_sublex, $this->cf_suplong_subascii, $this->cf_suplong_subutf8, $this->cf_valid_long, $this->cf_valid_int, $this->cf_valid_time, $this->cf_valid_lex, $this->cf_valid_ascii, $this->cf_valid_utf8, $this->cf_valid_bytes, $this->cf_def_valid);
$this->TIME1 = CassandraUtil::uuid1();
$this->TIME2 = CassandraUtil::uuid1();
$this->TIME3 = CassandraUtil::uuid1();
$this->LEX1 = UUID::import('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')->bytes;
$this->LEX2 = UUID::import('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb')->bytes;
$this->LEX3 = UUID::import('cccccccccccccccccccccccccccccccc')->bytes;
parent::__construct();
}
示例7: remover
/**
* @param mixed $id
* @return WeLearn_DTO_IDTO
*/
public function remover($id)
{
$UUID = UUID::import($id)->bytes;
$notificacaoRemovida = $this->recuperar($id);
$this->_cf->remove($UUID);
$usuarioId = $notificacaoRemovida->getDestinatario()->getId();
$this->_notificacoesPorUsuarioCF->remove($usuarioId, array($UUID));
$this->_notificacoesNovasPorUsuarioCF->remove($usuarioId, array($UUID));
}
示例8: recuperarPorOrdem
/**
* @param WeLearn_Cursos_Curso $doCurso
* @param int $nroOrdem
* @return WeLearn_Cursos_Conteudo_Modulo
*/
public function recuperarPorOrdem(WeLearn_Cursos_Curso $doCurso, $nroOrdem)
{
$cursoUUID = UUID::import($doCurso->getId())->bytes;
$idModulo = $this->_moduloPorCursoCF->get($cursoUUID, array((int) $nroOrdem));
$idModulo = $idModulo[$nroOrdem];
$column = $this->_cf->get($idModulo);
return $this->_criarFromCassandra($column, $doCurso);
}
示例9: alterarAtivo
/**
* @param WeLearn_Cursos_Certificado $certificado
* @return void
*/
public function alterarAtivo(WeLearn_Cursos_Certificado $certificado)
{
try {
$cursoUUID = UUID::import($certificado->getCurso()->getId());
$idCertificadoAtivo = $this->_cursoDao->getCf()->get($cursoUUID->bytes, array('certificado'));
$idCertificadoAtivo = $idCertificadoAtivo['certificado'];
} catch (cassandra_NotFoundException $e) {
$idCertificadoAtivo = '';
}
if ($certificado->isAtivo()) {
if ($idCertificadoAtivo != $certificado->getId()) {
$this->_cursoDao->getCf()->insert($cursoUUID->bytes, array('certificado' => $certificado->getId()));
if ($idCertificadoAtivo) {
$UUIDInativo = UUID::import($idCertificadoAtivo)->bytes;
$this->_cf->insert($UUIDInativo, array('ativo' => 'false'));
}
}
} else {
if ($idCertificadoAtivo == $certificado->getId()) {
$this->_cursoDao->getCf()->insert($cursoUUID->bytes, array('certificado' => ''));
}
}
}
示例10: recuperarTodosIdsVotantes
/**
* @param WeLearn_Cursos_SugestaoCurso $sugestao
* @return array
*/
public function recuperarTodosIdsVotantes(WeLearn_Cursos_SugestaoCurso $sugestao)
{
$sugestaoUUID = UUID::import($sugestao->getId())->bytes;
return array_keys($this->_sugestaoUsuariosVotantesCF->get($sugestaoUUID, null, '', '', false, 1000000));
}
示例11: _criarFromCassandra
private function _criarFromCassandra(array $column, WeLearn_Cursos_ParticipacaoCurso $participacaoCurso, WeLearn_Cursos_Avaliacoes_Avaliacao $avaliacao = null)
{
$column['participacaoCurso'] = $participacaoCurso;
$column['avaliacao'] = $avaliacao instanceof WeLearn_Cursos_Avaliacoes_Avaliacao ? $avaliacao : $this->_avaliacaoDao->recuperar($column['avaliacao']);
$controleAvaliacao = $this->criarNovo();
$controleAvaliacao->fromCassandra($column);
try {
$respostasIds = $this->_respostasAvaliacaoCF->get($controleAvaliacao->getId());
$UUIDs = array();
foreach ($respostasIds as $id) {
$UUIDs[] = UUID::import($id)->bytes;
}
$controleAvaliacao->setRespostas($this->_alternativasDao->recuperarTodosPorUUIDs($UUIDs));
} catch (cassandra_NotFoundException $e) {
}
return $controleAvaliacao;
}
示例12: respostasToCassandra
/**
* @return array
*/
public function respostasToCassandra()
{
$respostasColumnArray = array();
for ($i = 0; $i < count($this->_respostas); $i++) {
$questaoUUID = UUID::import($this->_respostas[$i]->getQuestaoId())->bytes;
$respostaUUID = UUID::import($this->_respostas[$i]->getId())->bytes;
$respostasColumnArray[$questaoUUID] = $respostaUUID;
}
return $respostasColumnArray;
}
示例13: toCassandra
/**
* Converte os dados das propriedades do objeto em um array para ser persistido no BD Cassandra
*
* @return array
*/
public function toCassandra()
{
$UUID = UUID::import($this->getPagina()->getId())->bytes;
return array($UUID => $this->getStatus());
}
示例14: removerTodosConvitesGerenciador
/**
* @param array $idsUsuarios
* @param WeLearn_Cursos_Curso $curso
*/
public function removerTodosConvitesGerenciador(array $idsUsuarios, WeLearn_Cursos_Curso $curso)
{
$cursoUUID = UUID::import($curso);
$this->_usuariosPorCursoCF->remove($cursoUUID->bytes, array($idsUsuarios));
foreach ($idsUsuarios as $id) {
$this->_cursosPorConviteGerenciadorCF->remove($id, array($cursoUUID->bytes));
}
}
示例15: recuperar
/**
* @param WeLearn_Cursos_Conteudo_Modulo $modulo
* @param WeLearn_Cursos_ParticipacaoCurso $participacaoCurso
* @return WeLearn_Cursos_Conteudo_ControleModulo
*/
public function recuperar(WeLearn_Cursos_Conteudo_Modulo $modulo, WeLearn_Cursos_ParticipacaoCurso $participacaoCurso)
{
$moduloUUID = UUID::import($modulo->getId())->bytes;
$column = $this->_cf->get($participacaoCurso->getCFKey(), array($moduloUUID));
return $this->_criarFromCassandra($column, $participacaoCurso, $modulo);
}