Skip to content
Permalink
Browse files

Introducing isReply()

  • Loading branch information...
benwerd committed Jul 11, 2015
1 parent 52a22f3 commit 005542d1617686fca7196dcf071ca82c503382d9
Showing with 20 additions and 0 deletions.
  1. +20 −0 Idno/Common/Entity.php
@@ -12,6 +12,7 @@
namespace Idno\Common {
use Idno\Core\Webmention;
use Idno\Entities\User;
class Entity extends Component implements EntityInterface
@@ -1257,6 +1258,18 @@ function isPublic()
return false;
}
/**
* Is this entity a reply to another entity?
* @return bool
*/
function isReply()
{
if (!empty($this->inreplyto)) {
return true;
}
return false;
}
/**
* Returns the database collection that this object should be
* saved as part of
@@ -1590,6 +1603,13 @@ function addWebmentions($source, $target, $source_content, $source_mf2)
}
}
$this->save();
if ($return) {
if ($this->isReply()) {
$webmentions = new Webmention();
$webmentions->pingMentions($this->getDisplayURL());
}
}
}
return $return;

0 comments on commit 005542d

Please sign in to comment.
You can’t perform that action at this time.