本文整理汇总了PHP中Property::destroy方法的典型用法代码示例。如果您正苦于以下问题:PHP Property::destroy方法的具体用法?PHP Property::destroy怎么用?PHP Property::destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Property
的用法示例。
在下文中一共展示了Property::destroy方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_destroying_should_cascade
public function test_destroying_should_cascade()
{
$Property = new Property(array('description' => 'This is a Property'));
$Picture = $Property->picture->create(array('title' => 'Front'));
$Property->destroy();
$this->assertFalse($this->Property->find('first', array('default' => false)));
$this->assertFalse($this->Picture->find('first', array('default' => false)));
}
示例2: destroy
/**
* Remove the specified resource from storage.
* DELETE /properties/{id}
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
$status = Property::destroy($id);
return $status ? ['status' => true] : ['status' => false];
}
示例3: test_clean_up_dependencies
public function test_clean_up_dependencies()
{
$Property = new Property('description->', 'Luxury Estate');
$PropertyType = new PropertyType();
$this->assertTrue($PropertyType =& $PropertyType->create(array('description' => 'Mansion')));
$Property->property_type->add($PropertyType);
$this->assertTrue($Property->save());
$PropertyType =& $PropertyType->findFirstBy('description', 'Mansion');
$PropertyType->property->load();
$this->assertEqual($PropertyType->properties[0]->getId(), $Property->getId());
$this->assertEqual($PropertyType->property->count(), 1);
$this->assertTrue($Property->destroy());
$PropertyType =& $PropertyType->findFirstBy('description', 'Mansion');
$PropertyType->property->load();
$this->assertTrue(empty($PropertyType->properties[0]));
$this->assertEqual($PropertyType->property->count(), 0);
}
示例4: getDestroy
/**
* Remove the specified property from storage.
*
* @param int $id
* @return Response
*/
public function getDestroy($id)
{
Property::destroy($id);
return Redirect::action('PropertiesController@getIndex');
}
示例5: destroy
/**
* Remove the specified kin from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
$property = Property::findOrFail($id);
Property::destroy($id);
Audit::logaudit('Properties', 'delete', 'deleted: ' . $property->name);
return Redirect::route('Properties.index')->withDeleteMessage('Company Property successfully deleted!');
}
示例6: test_clean_up_dependencies
public function test_clean_up_dependencies()
{
$Property = new Property(array('description' => 'Ruins in Matamon'));
$this->assertTrue($Property->save());
$South =& $Property->picture->create(array('title' => 'South views'));
$this->assertReference($South, $Property->pictures[0]);
$this->assertFalse($South->isNewRecord());
$pic_id = $South->getId();
$Property = new Property($Property->getId());
$this->assertTrue($Property->destroy());
$Picture = new Picture();
$this->assertFalse($Picture->find($pic_id));
}