Create the array of article entries

@param  array $data
@throws Zend_Feed_Builder_Exception
@return void
761774
private function _createEntries(array $data)
    {
        foreach ($data as $row) {
            $mandatories = array('title', 'link', 'description');
            foreach ($mandatories as $mandatory) {
                if (!isset($row[$mandatory])) {
                    /**
                     * @see Zend_Feed_Builder_Exception
                     */
                    require_once 'Zend/Feed/Builder/Exception.php';
                    throw new Zend_Feed_Builder_Exception("$mandatory key is missing");
                }
            }
            $entry = new Zend_Feed_Builder_Entry($row['title'], $row['link'], $row['description']);
            if (isset($row['author'])) {
                $entry->setAuthor($row['author']);
            }
            if (isset($row['guid'])) {
                $entry->setId($row['guid']);
            }
            if (isset($row['content'])) {
                $entry->setContent($row['content']);
            }
            if (isset($row['lastUpdate'])) {
                $entry->setLastUpdate($row['lastUpdate']);
            }
            if (isset($row['comments'])) {
                $entry->setCommentsUrl($row['comments']);
            }
            if (isset($row['commentRss'])) {
                $entry->setCommentsRssUrl($row['commentRss']);
            }
            if (isset($row['source'])) {
                $mandatories = array('title', 'url');
                foreach ($mandatories as $mandatory) {
                    if (!isset($row['source'][$mandatory])) {
                        /**
                         * @see Zend_Feed_Builder_Exception
                         */
                        require_once 'Zend/Feed/Builder/Exception.php';
                        throw new Zend_Feed_Builder_Exception("$mandatory key of source property is missing");
                    }
                }
                $entry->setSource($row['source']['title'], $row['source']['url']);
            }
            if (isset($row['category'])) {
                $entry->setCategories($row['category']);
            }
            if (isset($row['enclosure'])) {
                $entry->setEnclosures($row['enclosure']);
            }

            $this->_entries[] = $entry;
        }
    }
151623
public static function createFromArray(array $data)
    {
        $self = new self();

        if (isset($data['id'])) {
            $self->setId($data['id']);
        }
        if (isset($data['name'])) {
            $self->setName($data['name']);
        }
        if (isset($data['plural'])) {
            $self->setPlural($data['plural']);
        }
        if (isset($data['data_type'])) {
            $self->setDataType($data['data_type']);
        }
        if (isset($data['tags'])) {
            $self->setTags($data['tags']);
        }

        return $self;
    }
659979
public function add( $data )
	{
		$enclosure = $this->_enclosure;

		foreach( (array) $data as $key => $entry )
		{
			$entry = str_replace( $this->_lineend, $this->_endsubst, $entry );
			$data[$key] = $enclosure . str_replace( $enclosure, $this->_escape . $enclosure, $entry ) . $enclosure;
		}

		if( fwrite( $this->_fh, implode( $this->_separator, $data ) . $this->_lineend ) === false ) {
			throw new MW_Container_Exception( sprintf( 'Unable to add content to file "%1$s"', $this->getName() ) );
		}
	}
416429
public function rows(array $data): void
    {
        $this->rows = $data;
        $pdoStatement = $this->provideStatement();
        $this->execute($pdoStatement);
    }
1374919
public function populate($data = array())
    {
        if (isset($data['name']) && $data['name'] !== null) {
            $this->name = $data['name'];
        }

        if (isset($data['type']) && $data['type'] !== null) {
            $this->type = $data['type'];
        }
    }
975608
public function fill(array $data)
    {
        $this->attributes = array_merge($this->attributes, $this->filterFillable($data));
    }
1090576
public function setArray(array $data)
    {
        foreach ($data as $key => $value)
        {
            array_set($this->settings,$key,$value);
        }

        $this->save($this->path, $this->filename);
        $this->load($this->path, $this->filename);
    }
1081089
public function populate($data = array())
    {
        if (isset($data['id']) && $data['id'] != null) {
            $this->id    = $data['id'];
        }

        if (isset($data['roleId']) && $data['roleId'] != null) {
            $this->roleId    = $data['roleId'];
        }
        if (isset($data['parent']) && $data['parent'] != null) {
            $this->parent    = $data['parent'];
        }
    }
399008
public function populate($data = array())
    {
        if (isset($data['title']) && $data['title'] != null) {
            $this->title = $data['title'];
        }

        if (isset($data['subtitle'])) {
            $this->subtitle = $data['subtitle'];
        }
        
        if (isset($data['type']) && $data['type'] != null) {
            $this->type = $data['type'];
        }

        if (isset($data['media']) && $data['media'] != null) {
            $this->media = $data['media'];
        }

        if (isset($data['position']) && $data['position'] != null) {
            $this->position = $data['position'];
        }

        if (isset($data['description'])) {
            $this->description = $data['description'];
        }

        if (isset($data['link'])) {
            $this->link = $data['link'];
        }

        if (isset($data['linkText'])) {
            $this->linkText = $data['linkText'];
        }
    }
529576
public function fillFromArray(array $data)
	{
		$data = $data + array(
				'style' 		=> null,
				'align' 		=> null,
				'alternate_text' 	=> null,
				'title' 		=> null,
				'description' 	=> null,

				'size_width' 	=> null,
				'size_name' 	=> null,
				'crop_top' 		=> null,
				'crop_left' 	=> null,
				'crop_width' 	=> null,
				'crop_height' 	=> null,

				'size_height' 	=> null,
			);

		$this->imageId = $data['id'];
		$this->align = $data['align'];
		$this->style = $data['style'];
		$this->alternateText = $data['alternate_text'];
		$this->title = $data['title'];
		$this->description = $data['description'];

		$this->sizeName = $data['size_name'];

		$this->setWidth($data['size_width']);
		$this->setHeight($data['size_height']);
		$this->setCropTop($data['crop_top']);
		$this->setCropLeft($data['crop_left']);
		$this->setCropWidth($data['crop_width']);
		$this->setCropHeight($data['crop_height']);
	}
306610
public function populate($data = array())
    {
        $this->title = (isset($data['title'])) ? $data['title'] : null;
        if (isset($data['is_active']) && $data['is_active'] != null) {
            $this->is_active = $data['is_active'];
        }
        if (isset($data['content']) && $data['content'] != null) {
            $this->content = $data['content'];
        }
        $this->identifier = (isset($data['identifier'])) ? $data['identifier'] : null;
    }
653902
public function createActions(array $data): array
    {
        return array_map(function ($data) {
            if ($data instanceof RuleAction) {
                return $data;
            }

            return RuleAction::createFromData((array) $data);
        }, $data);
    }
1277169
public function create_record(array $data) {
		if(is_array($data) && count($data)) {
			$params = array();
			$sqlFields = "";
			$sqlValues = "";
			foreach($data as $field=>$value) {
				$sqlFields = ToolBox::create_list($sqlFields, $field, ", ");
				$sqlValues = ToolBox::create_list($sqlValues, ':'. $field, ", ");
				$params[$field] = $value;
			}
			
			$sql = 'INSERT INTO '. $this->tableName .' ('. $sqlFields .') VALUES ('. $sqlValues .')';			
			
			try {
				$newId = $this->dbObj->run_insert($sql, $params, $this->seqName);
			}
			catch(Exception $e) {
				throw new Exception(__METHOD__ .":: failed to create record, DETAILS::: ". $e->getMessage());
			}
		}
		else {
			throw new Exception(__METHOD__ .":: no data passed");
		}
		return($newId);
	}
367799
public function populate($data = array())
    {
        if (isset($data['title']) && $data['title'] != null) {
            $this->title = $data['title'];
        }

        if (isset($data['image']) && $data['image'] != null) {
            $this->image = $data['image'];
        }

        if (isset($data['area']) && $data['area'] != null) {
            $this->area = $data['area'];
        }

        if (isset($data['package']) && $data['package'] != null) {
            $this->package = $data['package'];
        }

        if (isset($data['theme']) && $data['theme'] != null) {
            $this->theme = $data['theme'];
        }

        if (isset($data['author']) && $data['author'] != null) {
            $this->author = $data['author'];
        }

        if (isset($data['is_active']) && $data['is_active'] != null) {
            $this->is_active = $data['is_active'];
        }
    }
1319286
public function create(array $data)
    {
        $entityManager = $this->getServiceManager()->get('doctrine.entitymanager.orm_default');
        $zfcUserOptions = $this->getServiceManager()->get('zfcuser_module_options');
        $class = $zfcUserOptions->getUserEntityClass();
        $user  = new $class;
        $form  = $this->getServiceManager()->get('playgrounduseradmin_register_form');
        $form->get('dob')->setOptions(array('format' => 'Y-m-d'));

        $form->bind($user);

        $avatarPath = $this->getOptions()->getAvatarPath() . DIRECTORY_SEPARATOR;
        if (!is_dir($avatarPath)) {
            mkdir($avatarPath, 0777, true);
        }
        $avatarUrl = $this->getOptions()->getAvatarUrl() . '/';

        $clearPassword = (isset($data['password']))?  $data['password'] : '';

        if ($this->getOptions()->getCreateUserAutoPassword()) {
            $rand = \Zend\Math\Rand::getString(8);
            $clearPassword = $rand;
            $bcrypt = new Bcrypt;
            $bcrypt->setCost($zfcUserOptions->getPasswordCost());
            $pass = $bcrypt->create($rand);
            /*$data = array_merge(
                $data,
                array('password'=> $pass)
            );*/
            $user->setPassword($pass);
        }

        $filter = $user->getInputFilter();
        $filter->remove('password');
        $filter->remove('passwordVerify');
        $filter->get('title')->setRequired(false);
        $filter->remove('firstname');
        $filter->remove('lastname');
        $filter->remove('postalCode');
        //$filter->remove('dob');
        $form->setInputFilter($filter);

        $emailInput = $form->getInputFilter()->get('email');
        $noObjectExistsValidator = new NoObjectExistsValidator(array(
                'object_repository' => $entityManager->getRepository($class),
                'fields'            => 'email',
                'messages'          => array('objectFound' => 'This email already exists !')
        ));

        $emailInput->getValidatorChain()->addValidator($noObjectExistsValidator);

        if (!$zfcUserOptions->getEnableUsername()) {
            unset($data['username']);
        }

        if (!$zfcUserOptions->getEnableDisplayName()) {
            unset($data['display_name']);
        }

        // If user state is enabled, set the default state value
        if ($zfcUserOptions->getEnableUserState()) {
            if ($zfcUserOptions->getDefaultUserState()) {
                /*$data = array_merge(
                    $data,
                    array('state'=> $zfcUserOptions->getDefaultUserState())
                );*/
                $user->setState((int) $zfcUserOptions->getDefaultUserState());
            }
        }

        // If avatar is set, I prepend the url path to the image
        $fileName=null;
        if (isset($data['avatar'])) {
            $fileName = $data['avatar'];
            $data['avatar'] = $avatarUrl . $fileName;
        }

        if (!isset($data['username']) || $data['username'] == '') {
            $data['username'] = ucfirst($data['firstname']) . " " . substr(ucfirst($data['lastname']), 0, 1);
        }

        // Convert birth date format
        if (isset($data['dob']) && $data['dob']) {
            $tmpDate = \DateTime::createFromFormat('d/m/Y', $data['dob']);
            $data['dob'] = $tmpDate->format('Y-m-d');
        }

        $form->setData($data);

        if (!$form->isValid()) {
            if (isset($data['dob']) && $data['dob']) {
                $tmpDate = \DateTime::createFromFormat('Y-m-d', $data['dob']);
                $data['dob'] = $tmpDate->format('d/m/Y');
                $form->setData(array('dob' => $data['dob']));
            }
            return false;
        }

        $roleMapper          = $this->getRoleMapper();
        $defaultRegisterRole = $this->getOptions()->getDefaultRegisterRole();
        if (isset($data['roleId'])) {
            $role = $roleMapper->findByRoleId($data['roleId']);
        } else {
            $role = $roleMapper->findByRoleId($defaultRegisterRole);
        }
        if ($role) {
            $user->addRole($role);
        }

        if ($fileName) {
            $adapter = new \Zend\File\Transfer\Adapter\Http();
            $size = new Size(array('max'=>'500kb'));
            $adapter->setValidators(array($size), $fileName);

            if (!$adapter->isValid()) {
                $dataError = $adapter->getMessages();
                if (isset($dataError['fileSizeTooBig'])) {
                    $dataError['fileSizeTooBig'] = 'Votre fichier dépasse le poids autorisé';
                }
                $error = array();
                foreach ($dataError as $key => $row) {
                    $error[] = $row;
                }
                if (isset($data['dob']) && $data['dob']) {
                    $tmpDate = \DateTime::createFromFormat('Y-m-d', $data['dob']);
                    $data['dob'] = $tmpDate->format('d/m/Y');
                    $form->setData(array('dob' => $data['dob']));
                }
                $form->setMessages(array('avatar'=>$error ));
            } else {
                $adapter->setDestination($avatarPath);
                if ($adapter->receive($fileName)) {
                    $user = $this->getUserMapper()->insert($user);
                    $this->sendNewEmailMessage($user->getEmail(), $clearPassword);

                    return $user;
                }
            }
        } else {
            $user = $this->getUserMapper()->insert($user);
            $this->sendNewEmailMessage($user->getEmail(), $clearPassword);

            return $user;
        }

        return false;
    }
785791
public function createStructure( array $data )
    {
        $structure = parent::createStructure( $data );

        if ( $structure instanceof SiteInfoAwareInterface )
        {
            $structure->setSiteInfo( $this->getSiteInfo() );
        }

        return $structure;
    }
402991
public function insert(array $data)
    {
        $this->_setupPrimaryKey();

        /**
         * Zend_Db_Table assumes that if you have a compound primary key
         * and one of the columns in the key uses a sequence,
         * it's the _first_ column in the compound key.
         */
        $primary = (array) $this->_primary;
        $pkIdentity = $primary[(int)$this->_identity];

        /**
         * If this table uses a database sequence object and the data does not
         * specify a value, then get the next ID from the sequence and add it
         * to the row.  We assume that only the first column in a compound
         * primary key takes a value from a sequence.
         */
        if (is_string($this->_sequence) && !isset($data[$pkIdentity])) {
            $data[$pkIdentity] = $this->_db->nextSequenceId($this->_sequence);
            $pkSuppliedBySequence = true;
        }

        /**
         * If the primary key can be generated automatically, and no value was
         * specified in the user-supplied data, then omit it from the tuple.
         *
         * Note: this checks for sensible values in the supplied primary key
         * position of the data.  The following values are considered empty:
         *   null, false, true, '', array()
         */
        if (!isset($pkSuppliedBySequence) && array_key_exists($pkIdentity, $data)) {
            if ($data[$pkIdentity] === null                                        // null
                || $data[$pkIdentity] === ''                                       // empty string
                || is_bool($data[$pkIdentity])                                     // boolean
                || (is_array($data[$pkIdentity]) && empty($data[$pkIdentity]))) {  // empty array
                unset($data[$pkIdentity]);
            }
        }

        /**
         * INSERT the new row.
         */
        $tableSpec = ($this->_schema ? $this->_schema . '.' : '') . $this->_name;
        $this->_db->insert($tableSpec, $data);

        /**
         * Fetch the most recent ID generated by an auto-increment
         * or IDENTITY column, unless the user has specified a value,
         * overriding the auto-increment mechanism.
         */
        if ($this->_sequence === true && !isset($data[$pkIdentity])) {
            $data[$pkIdentity] = $this->_db->lastInsertId();
        }

        /**
         * Return the primary key value if the PK is a single column,
         * else return an associative array of the PK column/value pairs.
         */
        $pkData = array_intersect_key($data, array_flip($primary));
        if (count($primary) == 1) {
            reset($pkData);
            return current($pkData);
        }

        return $pkData;
    }