* @return Bookmark The found bookmark object.
* @throws NoResultException When you don't find it after all.
*/
+<<<<<<< .merge_file_ZPs3Af
static public function fromStored(Notice $stored)
{
return self::getByPK(array('uri' => $stored->getUri()));
}
public function getStored()
+=======
+ static function getByNotice(Notice $notice)
+>>>>>>> .merge_file_eD7Wwf
{
return Notice::getByKeys(array('uri' => $this->getUri()));
}
*
* @return Bookmark the Bookmark object
*/
+<<<<<<< .merge_file_ZPs3Af
static function saveActivityObject(ActivityObject $actobj, Notice $stored)
+=======
+ static function saveNew(Profile $profile, $title, $url, $rawtags, $description,
+ array $options=array())
+>>>>>>> .merge_file_eD7Wwf
{
$url = null;
// each extra element is array('tagname', array('attr'=>'val', ...), 'content')
throw new ClientException(sprintf(_m('Expected exactly 1 link rel=related in a Bookmark, got %1$d.'), count($relLinkEls)));
}
+<<<<<<< .merge_file_ZPs3Af
if (!strlen($actobj->title)) {
throw new ClientException(_m('You must provide a non-empty title.'));
}
if (!common_valid_http_url($url)) {
throw new ClientException(_m('Only web bookmarks can be posted (HTTP or HTTPS).'));
+=======
+ if (array_key_exists('uri', $options)) {
+ $other = Bookmark::getKV('uri', $options['uri']);
+ if (!empty($other)) {
+ // TRANS: Client exception thrown when trying to save a new bookmark that already exists.
+ throw new ClientException(_m('Bookmark already exists.'));
+ }
+>>>>>>> .merge_file_eD7Wwf
}
try {