protected $actions;
/**
- * @var string, SQL; a query which looks up the related entity
+ * @var string, SQL. Given a file ID, determine the entity+table it's attached to.
*
* ex: "SELECT if(cf.id,1,0) as is_valid, cef.entity_table, cef.entity_id
* FROM civicrm_file cf
$kernel,
'Attachment',
array('create', 'get', 'delete'),
+ // Given a file ID, determine the entity+table it's attached to.
'SELECT if(cf.id,1,0) as is_valid, cef.entity_table, cef.entity_id
FROM civicrm_file cf
LEFT JOIN civicrm_entity_file cef ON cf.id = cef.file_id
* @return array
* Array of newly created file property values.
* @throws API_Exception validation errors
+ * @see Civi\API\Subscriber\DynamicFKAuthorization
*/
function civicrm_api3_attachment_create($params) {
$this->kernel,
'FakeFile',
array('create', 'get'),
+ // Given a file ID, determine the entity+table it's attached to.
"select
case %1
when " . self::FILE_WIDGET_ID . " then 1