Doctrine Project

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Doctrine 2 - ORM
  • Doctrine 2 - ORM
  • DDC-952 Several features to batch eager selec...
  • DDC-865

Passing an array as parameter

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Sub-task Sub-task
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0-BETA4
  • Fix Version/s: 2.1
  • Component/s: DQL
  • Security Level: All
  • Labels:
    None

Description

First check the entites in attachments (I've deleted everything unnecessary for this example).

What I want to do is find multiple entities (I have their ids in array) and then do some action with each of them.

I'm trying to find those entites using IN operator in DQL query, but there is no way (or I was unable find it) to pass the array of ids as parameter to the query. I've tried several ways to do it (check the PictureRepository attachment) but none is working as i want. Further details are described in comments.

<?php
//I know i could use something like this but I wonder about the IN stetement right now. The example above is just for show.
foreach ($pictures as $value) {
$entity = $repository->find($value);
/...whatever i want to do with the $entity/
}
?>

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. File
    AlbumEntity.php
    07/Nov/10 8:33 AM
    0.4 kB
    Jáchym Toušek
  2. File
    IdEntity.php
    07/Nov/10 8:35 AM
    0.3 kB
    Jáchym Toušek
  3. File
    PictureEntity.php
    07/Nov/10 8:33 AM
    0.7 kB
    Jáchym Toušek
  4. File
    PictureRepository.php
    07/Nov/10 8:33 AM
    4 kB
    Jáchym Toušek

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • History
  • Activity
  • Source
Hide
Permalink
Benjamin Eberlei added a comment - 13/Mar/11 7:35 AM

This will be implemented as part of DDC-952

Show
Benjamin Eberlei added a comment - 13/Mar/11 7:35 AM This will be implemented as part of DDC-952
Hide
Permalink
Benjamin Eberlei added a comment - 16/Mar/11 6:35 PM

Implemented

Show
Benjamin Eberlei added a comment - 16/Mar/11 6:35 PM Implemented

People

  • Assignee:
    Benjamin Eberlei
    Reporter:
    Jáchym Toušek
Vote (0)
Watch (1)

Dates

  • Created:
    07/Nov/10 8:33 AM
    Updated:
    16/Mar/11 6:35 PM
    Resolved:
    16/Mar/11 6:35 PM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Doctrine Project. Try JIRA - bug tracking software for your team.