Version 4.7.6
This commit is contained in:
1 parent
8ba7d43898
commit
7b7404e741
1085 files changed
+30590
-7837
No files matched your search
@@ -644,7 +644,8 @@ class _Promote extends \IPS\Patterns\ActiveRecord
|
||||
$this->failed = ( $hasFailed ) ? $this->failed + 1 : 0;
|
||||
$this->returned = $returned;
|
||||
$this->save();
|
||||
}
|
||||
\IPS\Api\Webhook::fire( 'content_promoted', $this, $this->object()->webhookFilters() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save Changed Columns
|
||||
@@ -737,7 +738,7 @@ class _Promote extends \IPS\Patterns\ActiveRecord
|
||||
/**
|
||||
* Shorten URL.
|
||||
*
|
||||
* @param string $service Service key, (such as facebook or twitter)
|
||||
* @param string $service Service key, (such as twitter)
|
||||
* @return boolean
|
||||
*/
|
||||
public function serviceFailed( $service )
|
||||
@@ -755,7 +756,7 @@ class _Promote extends \IPS\Patterns\ActiveRecord
|
||||
/**
|
||||
* Returns text sent to a named service
|
||||
*
|
||||
* @param string $service Service key (twitter, facebook)
|
||||
* @param string $service Service key (twitter)
|
||||
* @param boolean $forDisplay Is this for display in output?
|
||||
* @return string|NULL
|
||||
*/
|
||||
@@ -774,7 +775,7 @@ class _Promote extends \IPS\Patterns\ActiveRecord
|
||||
/**
|
||||
* Sets text for a named service
|
||||
*
|
||||
* @param string $service Service key (twitter, facebook)
|
||||
* @param string $service Service key (twitter)
|
||||
* @param boolean $text Text to save
|
||||
* @return string|NULL
|
||||
*/
|
||||
@@ -788,7 +789,7 @@ class _Promote extends \IPS\Patterns\ActiveRecord
|
||||
/**
|
||||
* Return the published URL for this post
|
||||
*
|
||||
* @param string $service Service key, (such as facebook or twitter)
|
||||
* @param string $service Service key, (such as twitter)
|
||||
* @return string|NULL
|
||||
*/
|
||||
public function getPublishedUrl( $service )
|
||||
@@ -806,7 +807,7 @@ class _Promote extends \IPS\Patterns\ActiveRecord
|
||||
|
||||
return $this->object()->url();
|
||||
}
|
||||
catch ( \InvalidArgumentException $e )
|
||||
catch ( \InvalidArgumentException|\RuntimeException $e )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -816,7 +817,7 @@ class _Promote extends \IPS\Patterns\ActiveRecord
|
||||
/**
|
||||
* Attempt to get all responses for this ID
|
||||
*
|
||||
* @param string $service Service to return (twitter, facebook, etc)
|
||||
* @param string $service Service to return (facebook, etc)
|
||||
* @return array|NULL array( response_id => data )
|
||||
*/
|
||||
public function responses( $service )
|
||||
@@ -1399,4 +1400,27 @@ class _Promote extends \IPS\Patterns\ActiveRecord
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get output for API
|
||||
*
|
||||
* @param \IPS\Member|NULL $authorizedMember The member making the API request or NULL for API Key / client_credentials
|
||||
*
|
||||
* @apiresponse \IPS\Member promotedBy The member who promoted the content item
|
||||
* @apiresponse string itemClass The FQN classname
|
||||
* @apiresponse string itemTitle Title
|
||||
* @apiresponse string itemDescription The content
|
||||
* @apiresponse object item The promoted content item
|
||||
*
|
||||
*/
|
||||
public function apiOutput( \IPS\Member $authorizedMember = NULL )
|
||||
{
|
||||
return [
|
||||
'promotedBy' => $this->author()->apiOutput($authorizedMember),
|
||||
'itemClass' => \get_class($this->object()),
|
||||
'itemTitle' => $this->objectTitle,
|
||||
'itemDescription' => $this->objectMetaDescription,
|
||||
'item' => $this->object()->apiOutput($authorizedMember),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user