本文整理汇总了PHP中Addressbook_Controller_Contact::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Addressbook_Controller_Contact::delete方法的具体用法?PHP Addressbook_Controller_Contact::delete怎么用?PHP Addressbook_Controller_Contact::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Addressbook_Controller_Contact
的用法示例。
在下文中一共展示了Addressbook_Controller_Contact::delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testUseNotes
/**
* test useNotes
*/
public function testUseNotes()
{
$contact = $this->objects['initialContact'];
$contact1 = clone $contact;
$contact1->notes = array(new Tinebase_Record_RecordSet('Tinebase_Model_Note', array($this->objects['note'])));
$contact->notes = array(new Tinebase_Record_RecordSet('Tinebase_Model_Note', array($this->objects['note'])));
$newcontact1 = $this->_instance->create($contact1);
$this->_instance->delete($newcontact1);
$this->_instance->useNotes(false);
$this->objects['contact'] = $this->_instance->create($contact);
$compStr = 'Array
(
[0] => Array
(
[note_type_id] => 1
[note] => phpunit test note
[record_backend] => Sql
[id] =>
)
)';
$this->assertTrue($newcontact1->has('notes'));
$this->assertEquals($compStr, $newcontact1->notes[0]->note);
$this->setExpectedException('Tinebase_Exception_NotFound');
$this->objects['contact']->notes[0]->note = 'note';
}
示例2: testDeleteUserAccountContact
/**
* try to delete a contact
*
*/
public function testDeleteUserAccountContact()
{
$this->setExpectedException('Addressbook_Exception_AccessDenied');
$userContact = $this->_instance->getContactByUserId(Tinebase_Core::getUser()->getId());
$this->_instance->delete($userContact->getId());
}
示例3: _removeFixtures
protected function _removeFixtures()
{
if ($this->_customerRecords) {
Sales_Controller_Customer::getInstance()->delete($this->_customerRecords->getId());
}
if ($this->_contactRecords) {
$this->_contactController->delete($this->_contactRecords->getId());
}
if ($this->_addressRecords) {
$this->_addressController->delete($this->_addressRecords->getId());
}
if ($this->_contractRecords) {
Sales_Controller_Contract::getInstance()->delete($this->_contractRecords->getId());
}
$paController = Sales_Controller_ProductAggregate::getInstance();
$paController->deleteByFilter(new Sales_Model_ProductAggregateFilter(array()));
$this->_invoiceController = Sales_Controller_Invoice::getInstance();
$this->_invoiceController->deleteByFilter(new Sales_Model_InvoiceFilter(array()));
}