public function call_write_argument($domains, $arg) { $a_type = argument_type($domains, $arg); if ($a_type == 'bit') { $this->bit_args[] = '$' . to_snake_case($arg['name']); return ''; } else { $ret = $this->write_bits(); $ret .= "\t\t\$args->write_" . $a_type . '($' . to_snake_case($arg['name']) . ");\n"; return $ret; } }
function method_map($json_spec) { $ret = array(); foreach ($json_spec['classes'] as $c) { foreach ($c['methods'] as $m) { $ret[$c['id'] . "," . $m['id']] = $c['name'] . '_' . to_snake_case($m['name']); } } return var_export($ret, true); }
/** * Returns the name of the table for the given entity * * @return string The name of the table for the given entity */ public function getTable() { $ns_class = get_class($this); $parts = explode('\\', $ns_class); $class = end($parts); return to_snake_case($class); }
public function call_write_argument($domains, $arg) { $a_type = argument_type($domains, $arg); if ($a_type == 'bit') { $this->bit_args[] = '$' . to_snake_case($arg['name']); $ret = ''; } else { $ret = $this->write_bits(); $a_name = '$' . to_snake_case($arg['name']); $ret .= '$writer->write_' . $a_type . '(' . ($a_type === 'table' ? 'empty(' . $a_name . ') ? array() : ' : '') . $a_name . ");\n"; } return $ret; }