本文整理汇总了PHP中TRecord::store方法的典型用法代码示例。如果您正苦于以下问题:PHP TRecord::store方法的具体用法?PHP TRecord::store怎么用?PHP TRecord::store使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TRecord
的用法示例。
在下文中一共展示了TRecord::store方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
public function store()
{
//sobrescrito!
parent::store();
parent::saveAggregate('AlunoTurma', 'turma_id', 'matricula_aluno', $this->id, $this->alunos);
parent::saveAggregate('TurmaDisciplina', 'turma_id', 'disciplina_id', $this->id, $this->disciplinas);
}
示例2: store
public function store()
{
// armazena a venda
parent::store();
// percorre os itens da venda
foreach ($this->itens as $item) {
$item->id_venda = $this->id;
// armazena o item
$item->store();
}
}
示例3: store
public function store()
{
parent::store();
$criteria = new TCriteria();
$criteria->add(new TFilter('tb_imovel_imovel_id', '=', $this->imovel_id));
$repository = new TRepository('ImovelProprietarios');
$repository->delete($criteria);
if ($this->proprietarios) {
foreach ($this->proprietarios as $proprietario) {
$imovelproprietarios = new ImovelProprietarios();
$imovelproprietarios->tb_contribuinte_contribuinte_id = $proprietario->proprietarios_id;
$imovelproprietarios->tb_imovel_imovel_id = $this->imovel_id;
$imovelproprietarios->store();
}
}
}
示例4: store
public function store()
{
// store the object itself
parent::store();
$criteria = new TCriteria();
$criteria->add(new TFilter('tb_logradouros_logra_id', '=', $this->logra_id));
$repository = new TRepository('LogradouroBairro');
$repository->delete($criteria);
if ($this->bairros) {
foreach ($this->bairros as $bairro) {
$logradourobairros = new LogradouroBairro();
$logradourobairros->tb_bairros_bairros_id = $bairro->bairros_id;
$logradourobairros->tb_logradouros_logra_id = $this->logra_id;
$logradourobairros->store();
}
}
}
示例5: store
/**
* Store the object and its aggregates
*/
public function store()
{
// store the object itself
parent::store();
// delete the related Contact objects
$criteria = new TCriteria();
$criteria->add(new TFilter('customer_id', '=', $this->id));
$repository = new TRepository('Contact');
$repository->delete($criteria);
// store the related Contact objects
if ($this->contacts) {
foreach ($this->contacts as $contact) {
unset($contact->id);
$contact->customer_id = $this->id;
$contact->store();
}
}
}
示例6: store
/**
* Store the object and its aggregates
*/
public function store()
{
// store the object itself
parent::store();
// delete the related System_groupSystem_program objects
$criteria = new TCriteria();
$criteria->add(new TFilter('system_group_id', '=', $this->id));
$repository = new TRepository('SystemGroupProgram');
$repository->delete($criteria);
// store the related System_groupSystem_program objects
if ($this->system_programs) {
foreach ($this->system_programs as $system_program) {
$system_group_system_program = new SystemGroupProgram();
$system_group_system_program->system_program_id = $system_program->id;
$system_group_system_program->system_group_id = $this->id;
$system_group_system_program->store();
}
}
}
示例7: store
/**
* Store the object and its aggregates
*/
public function store()
{
// store the object itself
parent::store();
// delete the related CustomerSkill objects
$criteria = new TCriteria();
$criteria->add(new TFilter('customer_id', '=', $this->id));
$repository = new TRepository('CustomerSkill');
$repository->delete($criteria);
// store the related CustomerSkill objects
if ($this->skills) {
foreach ($this->skills as $skill) {
$customer_skill = new CustomerSkill();
$customer_skill->skill_id = $skill->id;
$customer_skill->customer_id = $this->id;
$customer_skill->store();
}
}
}
示例8: store
/**
* Store the object and its aggregates
*/
public function store()
{
// store the object itself
parent::store();
// delete the related Item objects
$criteria = new TCriteria();
$criteria->add(new TFilter('srp_id', '=', $this->id));
$repository = new TRepository('Item');
$repository->delete($criteria);
// store the related Item objects
if ($this->items) {
foreach ($this->items as $item) {
unset($item->id);
$item->srp_id = $this->id;
$item->store();
}
}
}
示例9: store
/**
* Store the object and its aggregates
*/
public function store()
{
// store the object itself
parent::store();
parent::saveAggregate('CustomerSkill', 'customer_id', 'skill_id', $this->id, $this->skills);
parent::saveComposite('Contact', 'customer_id', $this->id, $this->contacts);
}
示例10: store
/**
* Stores the book and the aggregates (authors, subjects, items)
*/
public function store()
{
// stores the Book
parent::store();
// delete the aggregates
$criteria = new TCriteria();
$criteria->add(new TFilter('book_id', '=', $this->id));
$repository = new TRepository('BookAuthor');
$repository->delete($criteria);
$repository = new TRepository('BookSubject');
$repository->delete($criteria);
$repository = new TRepository('Item');
$repository->delete($criteria);
// store the authors
if ($this->authors) {
foreach ($this->authors as $author) {
$book_author = new BookAuthor();
$book_author->book_id = $this->id;
$book_author->author_id = $author->id;
$book_author->store();
}
}
// store the subjects
if ($this->subjects) {
foreach ($this->subjects as $subject) {
$book_subject = new BookSubject();
$book_subject->book_id = $this->id;
$book_subject->subject_id = $subject->id;
$book_subject->store();
}
}
// store the items
if ($this->items) {
foreach ($this->items as $item) {
$item->book_id = $this->id;
$item->store();
}
}
}
示例11: store
public function store()
{
parent::store();
//parent::saveComposite('endereco','idpessoa',$this->idpessoa,$this->enderecos);
parent::saveComposite('contato', 'idpessoa', $this->idpessoa, $this->contatos);
}
示例12: store
/**
* Store the object and its aggregates
*/
public function store()
{
// store the object itself
parent::store();
parent::saveAggregate('PedidosProdutos', 'pedidos_id', 'produtos_id', $this->id, $this->produtoss);
}
示例13: store
/**
* Stores the book and the aggregates (authors, subjects, items)
*/
public function store()
{
// stores the Book
parent::store();
// delete the aggregates
$criteria = new TCriteria();
$criteria->add(new TFilter('book_id', '=', $this->id));
$repository = new TRepository('BookAuthor');
$repository->delete($criteria);
$repository = new TRepository('BookSubject');
$repository->delete($criteria);
// collect persistent item ids
if ($this->items) {
foreach ($this->items as $item) {
if ($item->id) {
$item_ids[] = $item->id;
}
}
}
// delete all items, except for those that persist
$criteria->add(new TFilter('id', 'NOT IN', $item_ids));
$repository = new TRepository('Item');
$repository->delete($criteria);
// store the authors
if ($this->authors) {
foreach ($this->authors as $author) {
$book_author = new BookAuthor();
$book_author->book_id = $this->id;
$book_author->author_id = $author->id;
$book_author->store();
}
}
// store the subjects
if ($this->subjects) {
foreach ($this->subjects as $subject) {
$book_subject = new BookSubject();
$book_subject->book_id = $this->id;
$book_subject->subject_id = $subject->id;
$book_subject->store();
}
}
// store the items
if ($this->items) {
foreach ($this->items as $item) {
$item->book_id = $this->id;
$item->store();
}
}
}
示例14: store
/**
* Store the object and its aggregates
*/
public function store()
{
// store the object itself
parent::store();
// delete the related ItemCessao objects
$criteria = new TCriteria();
$criteria->add(new TFilter('cessao_id', '=', $this->id));
$repository = new TRepository('ItemCessao');
$repository->delete($criteria);
// store the related ItemCessao objects
if ($this->items) {
foreach ($this->items as $item) {
$cessao_item = new ItemCessao();
$cessao_item->item_id = $item->id;
$cessao_item->cessao_id = $this->id;
$cessao_item->quantidade = $item->quantidade;
$cessao_item->store();
}
}
}
示例15: store
/**
* Store the object and its aggregates
*/
public function store()
{
// store the object itself
parent::store();
// delete the related ItemRequisicao objects
$criteria = new TCriteria();
$criteria->add(new TFilter('requisicao_id', '=', $this->id));
$repository = new TRepository('ItemRequisicao');
$repository->delete($criteria);
// store the related ItemRequisicao objects
if ($this->items) {
foreach ($this->items as $item) {
$requisicao_item = new ItemRequisicao();
$requisicao_item->item_id = $item->id;
$requisicao_item->requisicao_id = $this->id;
$requisicao_item->justificativa = $item->justificativa;
$requisicao_item->quantidade = $item->quantidade;
$requisicao_item->prazoEntrega = $item->prazoEntrega;
$requisicao_item->store();
}
}
}