src/Mgallegos/DecimaFile/File/Services/FileManagement/FileManager.php
public function getElementFiles(array $systemReferences, $formatAsHtml = true, $databaseConnectionName = null, $organizationId = null)
  {
    $files = array();

    if(empty($organizationId))
    {
      $organizationId = $this->AuthenticationManager->getCurrentUserOrganizationId();
    }

    foreach ($systemReferences as $systemReference)
    {
      $this->File->bySystemReferenceTypeBySystemReferenceIdAndByOrganization($this->journalConfigurations[$systemReference['appId']]['journalizedType'][0], $systemReference['systemReferenceId'], $organizationId, $databaseConnectionName)->each(function($File) use (&$files)
      {
        // array_push($files, array('id' => $File->id, 'name' => $File->name, 'size' => $this->Storage->size($File->system_route), 'url' => $File->url, 'icon' => str_replace('font-size: 2em;', '', $File->icon_html)));
        array_push($files, array('id' => $File->id, 'name' => $File->name, 'size' => 0, 'url' => $File->url, 'icon' => str_replace('font-size: 2em;', '', $File->icon_html)));
      });
    }

    return json_encode($files);
  }
public function getElementFiles(array $systemReferences, $formatAsHtml = true, $databaseConnectionName = null, $organizationId = null)
  {
    $files = array();

    if(empty($organizationId))
    {
      $organizationId = $this->AuthenticationManager->getCurrentUserOrganizationId();
    }

    foreach ($systemReferences as $systemReference)
    {
      $this->File->bySystemReferenceTypeBySystemReferenceIdAndByOrganization($this->journalConfigurations[$systemReference['appId']]['journalizedType'][0], $systemReference['systemReferenceId'], $organizationId, $databaseConnectionName)->each(function($File) use (&$files)
      {
        // array_push($files, array('id' => $File->id, 'name' => $File->name, 'size' => $this->Storage->size($File->system_route), 'url' => $File->url, 'icon' => str_replace('font-size: 2em;', '', $File->icon_html)));
        array_push($files, array('id' => $File->id, 'name' => $File->name, 'size' => 0, 'url' => $File->url, 'icon' => str_replace('font-size: 2em;', '', $File->icon_html)));
      });
    }

    return json_encode($files);
  }
public function getElementFiles ( array $ systemReferences , $ formatAsHtml = true , $ databaseConnectionName = null , $ organizationId = null ) { $ files = array ( ) ; if ( empty ( $ organizationId ) ) { $ organizationId = $ this -> AuthenticationManager -> getCurrentUserOrganizationId ( ) ; } foreach ( $ systemReferences as $ systemReference ) { $ this -> File -> bySystemReferenceTypeBySystemReferenceIdAndByOrganization ( $ this -> journalConfigurations [ $ systemReference [ 'appId' ] ] [ 'journalizedType' ] [ 0 ] , $ systemReference [ 'systemReferenceId' ] , $ organizationId , $ databaseConnectionName ) -> each ( function ( $ File ) use ( & $ files ) { // array_push($files, array('id' => $File->id, 'name' => $File->name, 'size' => $this->Storage->size($File->system_route), 'url' => $File->url, 'icon' => str_replace('font-size: 2em;', '', $File->icon_html))); array_push ( $ files , array ( 'id' => $ File -> id , 'name' => $ File -> name , 'size' => 0 , 'url' => $ File -> url , 'icon' => str_replace ( 'font-size: 2em;' , '' , $ File -> icon_html ) ) ) ; } ) ; } return json_encode ( $ files ) ; }
Get element files by system parent type and by system parent id

@param array $systemReferences
An array of array as follows: array(array(appId => $appId, systemReferenceId = $systemReferenceId), array(appId => $appId, systemReferenceId = $systemReferenceId));
@param boolean $formatAsHtml

@return mixed $files
An ..
Get element files by system parent type and by system parent id