Skip to content

Instantly share code, notes, and snippets.

View AndreiLN's full-sized avatar

Andrei Luiz Nenevê AndreiLN

  • São Bento do Sul - SC - Brasil
View GitHub Profile
@AndreiLN
AndreiLN / doctrine_to_array.php
Created February 22, 2019 14:12
Converts Doctrine Model to Array
/**
* Converts doctrine to array
* @param $data
* @param $single it's run's only once (no recursion)
* @return array
*/
public function doctrine_to_array($data, $single = false) {
if (is_object($data)) { // its object
$methods = get_class_methods($data);
$methods = array_filter($methods, function($val){ return preg_match('/^get/', $val); });
# For some reason, installing Elixir tries to remove this file
# and if it doesn't exist, Elixir won't install. So, we create it.
sudo touch /etc/init.d/couchdb
# Standard Ubuntu Elixir installation instructions
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
sudo apt-get install elixir