PHP code example of willdurand / propel-typehintable-behavior

1. Go to this page and download the library: Download willdurand/propel-typehintable-behavior 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/ */

    

willdurand / propel-typehintable-behavior example snippets

 php


use FOS\UserBundle\Model\GroupInterface;

// ...

public function setRoles(array $v)
{
    if ($this->roles_unserialized !== $v) {
        $this->roles_unserialized = $v;
        $this->roles = '| ' . implode(' | ', $v) . ' |';
        $this->modifiedColumns[] = UserPeer::ROLES;
    }

    return $this;
}

public function addGroup(GroupInterface $group)
{
    if ($this->collGroups === null) {
        $this->initGroups();
    }
    if (!$this->collGroups->contains($group)) { // only add it if the **same** object is not already associated
        $this->doAddGroup($group);

        $this->collGroups[]= $group;
    }
}