Pommo_Api::getAttachmentsWithNames PHP 메소드

getAttachmentsWithNames() 공개 정적인 메소드

Get attachments names based on attachment indexes
public static getAttachmentsWithNames ( $attachments ) : array
리턴 array $result = Array with attachments details: array( array( 'id' => 1, 'name' => 'file.txt' ), array( 'id' => 2, 'name' => 'image.jpg' ) )
    public static function getAttachmentsWithNames($attachments)
    {
        if (empty($attachments)) {
            return false;
        }
        $attachments = explode(',', $attachments);
        $dbo = Pommo::$_dbo;
        $query = 'SELECT
                file_id, file_name
            FROM
                ' . $dbo->table['attachment_files'] . '
            WHERE
                file_id IN(%q)';
        $query = $dbo->prepare($query, array($attachments));
        $result = array();
        while ($row = $dbo->getRows($query)) {
            $result[] = $row;
        }
        return $result;
    }