query-builder Questions
1
I have a Model, Articles, which hasMany Abstracts. I want to load the 10 latest Articles, and for each Article, the Abstract with the highest number of points. My function looks like this:
public ...
Crossing asked 14/5, 2015 at 16:5
2
I have these timestamp columns in database table - expiration, edit, created_at. I need to order by 'edit', if item 'expiration' date is bigger than today's date, else I need to order by 'created_a...
Dowdell asked 17/3, 2015 at 14:8
1
Using symfony2/doctrine2, I have a hard time defining an index for my query.
My code :
$queryBuilder = $this->_em
->createQueryBuilder()
->select('u, uis, cost, p, stock')
->from(...
Post asked 23/4, 2015 at 15:11
1
Solved
My Laravel 5 app includes a dynamic query builder for report running. I need some group by clauses in there and have run into a problem. If I use actual sql in there I can have issues as sometimes ...
Rori asked 31/3, 2015 at 14:7
1
Solved
I'm using query builder to search for images in DAM. I use predicates to do that. I'm trying to check metadata dam:MIMEtype property, to return all nodes which starts from image/.
How can I do tha...
Starobin asked 23/2, 2015 at 22:17
1
Solved
I have a task - add to the search model searching by full name.
Full name is first name + last name. So I need to build query like
WHERE first_name LIKE '%var%' OR last_name LIKE '%var%'
The only ...
Manet asked 18/2, 2015 at 20:0
1
Solved
Edit:
Though this question originally was specific for the query I'm describing underneath, the answer I got applies to almost all questions related to using derived tables / subqueries in Laravel...
Midlands asked 4/2, 2015 at 10:39
1
I have two tables: contactperson and contactpersonlocale.
Table contactperson:
contactpersonID (Primary Key)
tag (VARCHAR)
Table contactpersonlocale:
contactpersonlocaleID (Primary Key)
co...
Connel asked 12/1, 2015 at 10:37
2
Solved
Is it possible to do the following in Laravel 4? ...
DB::table('myTable')
->select(DB::raw($columnNames))
->whereNotNull(function($query) use($columns) {
foreach ($columns as $column) {
...
Disproof asked 24/12, 2014 at 7:5
1
Solved
I have used whereOr and orWhere in my code in Laravel both works but at times gives different result
$user_query = User::select( 'users.id', 'users.username','users.first_name','users.last_name',...
Ethben asked 20/12, 2014 at 9:3
1
Solved
My question is simple : is it possible to add a where statment using doctrine and the query builder on a field type array ?
Inside my entity I have the following :
/**
* @var array
*
* @ORM\Co...
Evident asked 29/10, 2014 at 20:39
3
Could you recommend a JQuery plugin to compose a set of conditions mappable to a SQL query? [closed]
I've found http://redquerybuilder.appspot.com/ but that generates SQL client side which I want to avoid. On hat page there is a link to JQuery Query Builder plugin but that link goes to jquer...
Ania asked 5/3, 2014 at 5:44
2
Solved
I am developing an application using Symfony2 and Doctrine2. I also use Doctrine's QueryBuilder. I have this query:
public function getInterpDesberdinak($MarkId)
{
$qb = $this->createQueryBui...
Lick asked 19/5, 2012 at 11:25
3
Solved
I'd like to select members who are not in specific service. I have 3 tables :
membre
service
membre_service (relation between membre and service)
I'm using doctrine 2 and in SQL my query is :
...
Pfaff asked 12/8, 2012 at 17:16
2
Solved
I am trying to count the distinct number of IDs returned for a query with his:
$query = $repo->createQueryBuilder('prov')
->select('c.id')
->innerJoin('prov.products', 'prod')
->inne...
Coach asked 5/8, 2014 at 11:55
2
Solved
I'm developing an application that lists images, and has multiple tags assigned to each image. I'd like to be able to find the images that are tagged with all of the tags being searched for.
ima...
Pirog asked 11/7, 2014 at 18:23
2
Solved
I have the simplest of queries that I'm trying to run
DB::table('user_visits')->groupBy('user_id')->count();
But it's returning the wrong number, 8.
If I change it to this:
count(DB::tab...
Cropdusting asked 10/6, 2014 at 22:57
1
Solved
New to Symfony & Doctrine
I trying to fetch a selection of objects from a MySQL database via Doctrine in a Symfony project. I am doing this with createQueryBuilder;
$repository = $this->ge...
Trainor asked 6/6, 2014 at 12:17
5
Solved
I need to create a dynamic linq expression for a dynamic search.The basic search is working but it fails to work with collection.
I am able to get the book's title and author but fails to get the r...
Secondbest asked 18/5, 2014 at 2:42
2
Solved
i want to make a simple query, with multiple conditions
I use OrmLite to map entity object.
Now I want to search for an object into my table.
Supposing i have a Person entity that maps PERSON table...
Henninger asked 17/5, 2014 at 15:59
3
Solved
I have a problem while trying to USE QueryBuilder OR DQL.
I have the following relation:
User <-1:n-> Profile <-n:m-> RouteGroup <-1:n-> Route
I would like to make a DQL that lists all...
Falsework asked 13/11, 2012 at 1:33
2
I have been trying to come across a query builder for Neo4j's query language Cypher, ideally using a fluent API. I did not find much, and decided to invest some time on building one myself.
The re...
Osteopathy asked 16/2, 2014 at 18:48
1
Solved
I got an error [Syntax Error] line 0, col 81: Error: Expected Literal, got 'NULL' when I try to execute query via query builder
$qb = $this->createQueryBuilder('r')
->select('r')
->whe...
Interfluve asked 6/2, 2014 at 14:54
2
Ok i have this code:
SELECT
IFNULL(s2.id,s1.id) AS effectiveID,
IFNULL(s2.status, s1.status) AS effectiveStatus,
IFNULL(s2.user_id, s1.user_id) as effectiveUser,
IFNULL(s2.likes_count, s1.likes...
Alibi asked 24/4, 2013 at 21:11
2
Solved
I'm trying to create a form with data in collection type depending on the user being logged. I'm following this chapter of the Symfony cookbook.
Everything works fine when the query_builder option...
Bronchitis asked 16/7, 2013 at 12:39
© 2022 - 2024 — McMap. All rights reserved.