<query-mapping package='AWA.Images.Models'>
    <description>
      Information about an image
    </description>

    <class name="AWA.Images.Models.Image_Bean" bean="yes">
        <comment>The information about an image.</comment>
        <property type='Identifier' name="folder_id">
            <comment>the image folder identifier.</comment>
        </property>
        <property type='String' name="folder_name">
            <comment>the image folder name.</comment>
        </property>
        <property type='Identifier' name="id">
            <comment>the image file identifier.</comment>
        </property>
        <property type='String' name="name">
            <comment>the image file name.</comment>
        </property>
        <property type='Date' name="create_date">
            <comment>the file creation date.</comment>
        </property>
        <property type='String' name="uri">
            <comment>the file storage URI.</comment>
        </property>
        <property type='AWA.Storages.Models.Storage_Type' name="storage">
            <comment>the file storage URI.</comment>
        </property>
        <property type='String' name="mime_type">
            <comment>the file mime type.</comment>
        </property>
        <property type='Integer' name="file_size">
            <comment>the file size.</comment>
        </property>
        <property type='Boolean' name="is_public">
            <comment>whether the image is public.</comment>
        </property>
        <property type='Integer' name="width">
            <comment>the image width.</comment>
        </property>
        <property type='Integer' name="height">
            <comment>the image height.</comment>
        </property>
        <method name="load">
            <comment>load the bean</comment>
        </method>
    </class>

    <query name='image-info'>
       <comment>Get the description of an image.</comment>
       <sql>
    SELECT
      folder.id,
      folder.name,
      file.id,
      file.name,
      file.create_date,
      file.uri,
      file.storage,
      file.mime_type,
      file.file_size,
      file.is_public,
      image.width,
      image.height
    FROM awa_storage AS file
    INNER JOIN awa_acl AS acl ON acl.entity_id = file.workspace_id AND acl.entity_type = :table AND acl.user_id = :user_id
    INNER JOIN awa_storage_folder AS folder ON folder.id = file.folder_id
    INNER JOIN awa_image AS image ON file.id = image.storage_id
    WHERE file.id = :file_id
       </sql>
    </query>

</query-mapping>

Add XML query to get information about an image
Add XML query to get information about an image
