本文整理汇总了PHP中Node::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Node::delete方法的具体用法?PHP Node::delete怎么用?PHP Node::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Node
的用法示例。
在下文中一共展示了Node::delete方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete
public function delete()
{
$bigPath = $this->getBigPathName();
if (file_exists($bigPath)) {
unlink($bigPath);
}
parent::delete();
}
示例2: delete
public function delete()
{
// удалим связанные с этим типом документы
$this->getDB()->exec("DELETE FROM `node` WHERE `class` = :type", array(':type' => $this->name));
$rc = parent::delete();
$this->erase();
$this->flush();
return $rc;
}
示例3: delete
/**
* Removes record for given ID.
*
* @see Model::delete()
*/
public function delete($id = null, $cascade = true)
{
$attachment = $this->find('first', array('conditions' => array($this->alias . '.id' => $id, $this->alias . '.type' => $this->type)));
$filename = $attachment[$this->alias]['slug'];
$uploadsDir = WWW_ROOT . $this->uploadsDir . DS;
$fullpath = $uploadsDir . DS . $filename;
if (file_exists($fullpath)) {
$result = unlink($fullpath);
if ($result) {
$info = pathinfo($filename);
array_map('unlink', glob($uploadsDir . DS . 'resized' . DS . $info['filename'] . '.resized-*.' . $info['extension']));
return parent::delete($id, $cascade);
} else {
return false;
}
} else {
return parent::delete($id, $cascade);
}
}
示例4: testImplicitBatch_StartBatch_CloseBatch_ExpectedBatchRequest
public function testImplicitBatch_StartBatch_CloseBatch_ExpectedBatchRequest()
{
$startNode = new Node($this->client);
$endNode = new Node($this->client);
$endNode->setId(456)->useLazyLoad(false);
$rel = new Relationship($this->client);
$rel->setType('TEST')->setStartNode($startNode)->setEndNode($endNode);
$deleteNode = new Node($this->client);
$deleteNode->setId(987);
$deleteRel = new Relationship($this->client);
$deleteRel->setId(321);
$addIndexNode = new Node($this->client);
$addIndexNode->setId(654);
$removeIndexNode = new Node($this->client);
$removeIndexNode->setId(209);
$index = new Index($this->client, Index::TypeNode, 'indexname');
$request = array(array('id' => 0, 'method' => 'POST', 'to' => '/node', 'body' => null), array('id' => 1, 'method' => 'PUT', 'to' => '/node/456/properties', 'body' => array()), array('id' => 2, 'method' => 'POST', 'to' => '{0}/relationships', 'body' => array('to' => $this->endpoint . '/node/456', 'type' => 'TEST')), array('id' => 3, 'method' => 'DELETE', 'to' => '/node/987'), array('id' => 4, 'method' => 'DELETE', 'to' => '/relationship/321'), array('id' => 5, 'method' => 'POST', 'to' => '/index/node/indexname', 'body' => array('key' => 'addkey', 'value' => 'addvalue', 'uri' => $this->endpoint . '/node/654')), array('id' => 6, 'method' => 'DELETE', 'to' => '/index/node/indexname/removekey/removevalue/209'));
$return = array('code' => 200, 'data' => array(array('id' => 0, 'location' => 'http://foo:1234/db/data/node/123'), array('id' => 1), array('id' => 2, 'location' => 'http://foo:1234/db/data/relationship/789'), array('id' => 3), array('id' => 4), array('id' => 5), array('id' => 6)));
$this->setupTransportExpectation($request, $this->returnValue($return));
$batch = $this->client->startBatch();
$this->assertInstanceOf('Sgpatil\\Orientphp\\Batch', $batch);
$startNode->save();
$endNode->save();
$rel->save();
$deleteNode->delete();
$deleteRel->delete();
$index->add($addIndexNode, 'addkey', 'addvalue');
$index->remove($removeIndexNode, 'removekey', 'removevalue');
$this->assertTrue($this->client->commitBatch());
$this->assertEquals(789, $rel->getId());
$this->assertEquals(123, $startNode->getId());
}
示例5: delete
/**
* @return int
*/
public function delete()
{
//sys()->log("Data::delete() this:");
//sys()->log($this);
if ($this->is()) {
sys()->log("Data::delete() : path: " . $this->get('path'));
@unlink($this->get('path'));
parent::delete();
return 0;
} else {
sys()->log("Data::delete() : data object does not exists. File does not exists.");
return -1;
}
}
示例6: delete
/**
* Перемещение файла в корзину.
*
* Перед удалением файла из удаляет его версии из файлового кэша,
* т.к. файл более не будет доступен извне — его отмасштабированные
* версии не нужны.
*
* @return void
*/
public function delete()
{
return parent::delete();
}