tiitoo/parse-bundle

AdadgioParseBundle

维护者

详细信息

github.com/TiiToo/parse-bundle

源代码

安装: 6

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 1

类型:symfony-bundle

dev-master 2017-04-13 12:31 UTC

This package is auto-updated.

Last update: 2020-01-07 00:55:57 UTC


README

设置一组辅助函数,用于传递HTTP复杂查询并将其轻松转换为查询仓库

安装

使用composer安装。

composer require adadgio/parse-bundle

将以下更改应用到您的AppKernel.php文件中,修改已注册的bundle数组。

new Adadgio\ParseBundle\AdadgioParseBundle(),

要求

此bundle需要FosUserBundleAdadgioGearBundleAdadgioDQLBundle。但不用担心,这是在composer安装过程中自动完成的。

导入路由文件

// add routing
_adadgio_parse:
    resource: "@AdadgioParseBundle/Resources/config/routing.yml"

创建基类

创建一个安装实体,如下所示。

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Adadgio\ParseBundle\Entity\ParseInstallation;

/**
 * @ORM\Table(name="my_installation")
 * @ORM\Entity(repositoryClass="AppBundle\Repository\MyInstallationRepository")
 */
class MyInstallation extends ParseInstallation
{
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Up to you, but could be nice to link the installs with your users.
     * Dont forget to edit the relationshipon the user owning side as well.
     *
     * ORM\ManyToOne(targetEntity="AppBundle\Entity\User", inversedBy="installations")
     * ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true)
     */
    private $user;
}

配置参考

adadgio_parse:

    # the identity of your parse app
    # static api key auth
    application:
        client_id: anyTokenuLike
        client_key: anysEkreTY0liKe
        client_config: # optional, equivalent to parse config feature
            host: test-host.com
            protocol: test
            version: 1.1

    # misc config for external links in api returns
    miscellaneous:
        protocol: http://
        hostname: adadgio.dev

    # parse bundle internal and database settings
    settings:
        #field_prefix: m_ # optional, default null
        #never_prefixed: [ "email", "password" ] # optional, default [ "email", "password" ]
        #serialization:
            #hidden: ["password", "salt"]  # optional, defaults, when results are send from parse
        #conversion:
            #reserved: ["id", "objectId", "password", "salt", "email", "username", "confirmation_token"]  # optional, default, when results are received from parse
        #installation:
            #class: ~ # optional, default AppBundle\Entity\MyParseInstallation (if you wish to extend the install class)

    # your entities mapping(s)
    mapping:
        product:
            class: AppBundle\Entity\Product
            fields:
                id: 
                name: