Skip to content

Commit

Permalink
Version 0.0.46
Browse files Browse the repository at this point in the history
  • Loading branch information
francescobianco committed Oct 8, 2017
1 parent f501bc2 commit 08f8ca1
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "javanile/moldable",
"type": "library",
"version": "0.0.45",
"version": "0.0.46",
"description": "Uknown PHP Database Abstraction Layer",
"keywords": [
"moldable",
Expand Down
2 changes: 1 addition & 1 deletion src/Database/SchemaApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ public function info($model = null)
$this->info($m);
}
} elseif (is_array($model) && count($model) == 0) {
echo '<pre><table border="1" style="'.$style.'">'
echo '<pre><table border="1">'
.'<tr><th>No database tables</th></tr></table></pre>'
.'</table></pre>';
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ public static function varDump($var)
public static function dumpGrid($grid, $title = null)
{
$key = key($grid);
$n = count($grid) > 0 ? count((array) $grid[$key]) : 1;
$colspan = count($grid) > 0 ? count((array) $grid[$key]) : 1;

echo '<pre><table border="1" style="text-align:center;margin-bottom:1px;"><thead>';
if ($title) {
echo '<tr><th colspan="'.$n.'">'.$title.'</th></tr>';
echo '<tr><th colspan="'.$colspan.'">'.$title.'</th></tr>';
}

if (isset($grid[$key]) && is_array($grid[$key])) {
Expand Down
22 changes: 17 additions & 5 deletions src/Model/FieldApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function fillSchemaFields($values, $map = null, $prefix = null)
/**
* Retrieve primary key field name.
*
* @return bool
* @return string
*/
public static function getPrimaryKey()
{
Expand All @@ -92,8 +92,8 @@ public static function getPrimaryKey()
$key = null;
$schema = static::getSchema();

foreach ($schema as $field => &$attributes) {
if ($attributes['Key'] == 'PRI') {
foreach ($schema as $field => $aspects) {
if ($aspects['Key'] == 'PRI') {
$key = $field;
break;
}
Expand Down Expand Up @@ -123,7 +123,7 @@ public function getPrimaryKeyValue()
/**
* Retrieve primary key field name.
*
* @return bool
* @return string
*/
public static function getMainField()
{
Expand Down Expand Up @@ -158,6 +158,9 @@ public static function getMainField()
return static::getClassAttribute($attribute);
}

/**
* @return mixed
*/
public function getMainFieldValue()
{
//
Expand All @@ -182,7 +185,7 @@ protected static function getPrimaryKeyOrMainField()
/**
* Retrieve primary key field name.
*
* @return bool
* @return array
*/
protected static function getDefaultFields()
{
Expand Down Expand Up @@ -214,6 +217,9 @@ protected static function getDefaultFields()
return static::getClassAttribute($attribute);
}

/**
*
*/
public static function getFieldValues($field)
{
//
Expand Down Expand Up @@ -251,6 +257,9 @@ protected static function getStaticFields()
return static::getClassAttribute($attribute);
}

/**
*
*/
protected static function getAllFieldsValues()
{
$attribute = 'fields-values';
Expand All @@ -265,6 +274,9 @@ protected static function getAllFieldsValues()
return static::getClassAttribute($attribute);
}

/**
*
*/
protected static function getAllFields()
{
return array_keys(get_class_vars(static::getClass()));
Expand Down
1 change: 0 additions & 1 deletion src/Model/UpdateApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public static function update($query, $values = null, $map = null)
$params = [];
$setArray = [];
$whereArray = [];
$valuesArray = [];

foreach ($query as $field => $value) {
$token = ':'.$field.'0';
Expand Down
3 changes: 3 additions & 0 deletions src/Parser/Mysql/DatetimeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ private function getNotationAspectsDatetime(
return $aspects;
}

/**
*
*/
private static function getNotationAspectsTimestamp(
$notation,
$aspects
Expand Down
2 changes: 1 addition & 1 deletion src/Parser/Mysql/EnumTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private function getNotationAspectsEnum($notation, $aspects)
//
$enum = $this->parseEnumNotation($notation);
if (!$enum) {
return $this->getNotationAttributes('', $field, $before);
return $aspects;
}

//
Expand Down

0 comments on commit 08f8ca1

Please sign in to comment.