Giter VIP home page Giter VIP logo

Comments (8)

jobrienski avatar jobrienski commented on August 9, 2024

I'm workign on that

from parse.com-php-library.

jobrienski avatar jobrienski commented on August 9, 2024

Check out https://github.com/jobiwankanobi/parse.com-php-library/blob/master/parseQuery.php
I added the ability to query for roles in whereRelatedTo()

from parse.com-php-library.

jobrienski avatar jobrienski commented on August 9, 2024

Oops you'll also need: https://github.com/jobiwankanobi/parse.com-php-library/blob/master/parse.php
I changed how the keys are set at the top of the file, so you might just want to insert this section in the switch($type) section of dataType();

                                case 'relatedTo':
                                        $return = array(
                                            "object" => $params[0], // pointer
                                            "key" => $params[1] // key
                                        );
                                        break;

from parse.com-php-library.

 avatar commented on August 9, 2024

Hi thanks for your help

please view the code below

stdClass Object
(
[results] => Array
(
[0] => stdClass Object
(
[dateExpired] => stdClass Object
(
[__type] => Date
[iso] => 2012-12-31T04:00:00.000Z
)

                [dateIssued] => stdClass Object
                    (
                        [__type] => Date
                        [iso] => 2012-12-01T04:00:00.000Z
                    )

                [offeringText] => Once you redeem this coupon you will have 45 min and it will automatically delete from your phone.
                [percentOff] => 15
                [tier] => 1
                [title] => 15% Off
                [infProductObjectId] => stdClass Object
                    (
                        [__type] => Relation
                        [className] => infProduct
                    )

                [infManufacturerObjectId] => stdClass Object
                    (
                        [__type] => Relation
                        [className] => infManufacturer
                    )

                [createdAt] => 2012-12-06T23:59:58.672Z
                [updatedAt] => 2012-12-07T00:20:52.316Z
                [objectId] => wqS9t98m98
            )

    )

)

on this code i need to get [__type] => Relation of data but i am stuck here no way to get either on another new query or in same single query.

please help me for this

from parse.com-php-library.

jobrienski avatar jobrienski commented on August 9, 2024
    public function whereRelatedTo($key,$className,$objectId) {

I didn't get the classname from the code, but let's assume it's 'Offering'.
well with my new code, you could do another query that says:

$query = new Query('infManufacturer');
$query->whereRelatedTo('infManufacturerObjectId', 'Offering', 'wqS9t98m98');

By the way, I think your object model isn't correct. For one-to-one, you r infManufacturerObjectId should be a pointer instead of a relation. But I think it will still work as a relation.

from parse.com-php-library.

 avatar commented on August 9, 2024

Thanks for you reply.

let me tell you my table structure

i want to get results from "infCoupon" and it has field called "infManufacturerObjectId"(relation) with "infManufacturer" table.

now i want to get all results from infCoupon and with Manufacturer details as well.

as your provided code need's me to add objectId which is i can't understand.

Thanks,
Shahid

from parse.com-php-library.

 avatar commented on August 9, 2024

Yes thanks got it get result please confirm me one thing can i get this relation result in single query or i have to use sub query in for loop to get for each individual result.

from parse.com-php-library.

jobrienski avatar jobrienski commented on August 9, 2024

Oh good.
Subquery? I think yes. But try on query infCoupon

$query->whereInclude('infManufacturerObjectId'); 
$query->whereInclude('infProductObjectId');

from parse.com-php-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.