PHP code example of ynloultratech / graphql-media-service

1. Go to this page and download the library: Download ynloultratech/graphql-media-service library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ynloultratech / graphql-media-service example snippets


namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Ynlo\GraphQLBundle\Annotation as GraphQL;
use Ynlo\GraphQLMediaService\Model\AbstractFile;

/**
 * @ORM\Entity()
 * @ORM\Table()
 *
 * @GraphQL\ObjectType()
 */
class File extends AbstractFile
{

}

/**
 * @ORM\Entity()
 * @ORM\Table()
 *
 * @GraphQL\ObjectType()
 */
class Profile implements NodeInterface
{
//....
/**
 * @var File
 *
 * @ORM\OneToOne(targetEntity="AppBundle\Entity\File", orphanRemoval=true)
 *
 * @GraphQL\Expose()
 *
 * @MediaService\AttachFile()
 */
protected $photo;