PHP code example of lzakrzewski / facebook-authentication-bundle

1. Go to this page and download the library: Download lzakrzewski/facebook-authentication-bundle 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/ */

    

lzakrzewski / facebook-authentication-bundle example snippets


// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        // ...
        new Lzakrzewski\FacebookAuthenticationBundle\LzakrzewskiFacebookAuthenticationBundle(),
        // ...
    );
}


// src/AppBundle/Entity/User.php

namespace AppBundle\Entity;

use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
use Lzakrzewski\FacebookAuthenticationBundle\Model\FacebookUser;

/**
 * @ORM\Entity
 * @ORM\Table(name="users")
 */
class User extends BaseUser implements FacebookUser
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;

    /**
     * @ORM\Column(type="bigint", nullable=true)
     */
    private $facebookId;

    /** {@inheritdoc} */
    public function getFacebookId()
    {
        return $this->facebookId;
    }

    /** {@inheritdoc} */
    public function setFacebookId($facebookId)
    {
        $this->facebookId = $facebookId;
    }
}