Skip to content

Commit

Permalink
Merge pull request #71 from open-sausages/pulls/4/pre-array-glue-impl…
Browse files Browse the repository at this point in the history
…osion

BUG Move the glu before the array when calling implode
  • Loading branch information
dnsl48 authored Jul 21, 2020
2 parents 1af91b4 + 967a140 commit dc3f096
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions code/Employee.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,25 @@

namespace SilverStripe\FrameworkTest\Model;





use SilverStripe\Assets\Image;
use SilverStripe\Forms\CompositeField;
use SilverStripe\Forms\FieldGroup;
use SilverStripe\Forms\NumericField;
use SilverStripe\Forms\TextField;
use SilverStripe\ORM\Connect\MySQLSchemaManager;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\DB;
use SilverStripe\Forms\NumericField;
use SilverStripe\Forms\TextField;
use SilverStripe\Forms\DropdownField;
use SilverStripe\ORM\Filters\ExactMatchFilter;
use SilverStripe\ORM\Filters\FulltextFilter;
use SilverStripe\ORM\Filters\GreaterThanOrEqualFilter;
use SilverStripe\ORM\Filters\LessThanOrEqualFilter;


/**
* Description of Employees
*
* @property string $Name
* @property string $Biography
* @property string $DateOfBirth
* @property string $Category
* @property int $CompanyID
* @property int $ProfileImageID
* @method Company Company()
* @method Image ProfileImage()
*/
class Employee extends DataObject
{
Expand Down Expand Up @@ -120,12 +117,12 @@ public function requireDefaultRecords()
$employee = Employee::create([
'Name' => $employeeName,
'CompanyID' => $companyIDs[rand(0, $companyCount-1)],
'Biography' => implode([
'Biography' => implode(' ', [
$words[rand(0, $wordCount-1)],
$words[rand(0, $wordCount-1)],
$words[rand(0, $wordCount-1)],
$words[rand(0, $wordCount-1)],
], " "),
]),
'DateOfBirth' => date("Y-m-d", rand(0, 500) * 24 * 60 * 60),
'Category' => $categories[rand(0, 3)]
]);
Expand Down Expand Up @@ -197,6 +194,6 @@ public function getDefaultSearchContext()

public function getColleagueNames()
{
return implode($this->Company()->Employees()->column('Name'), ' ');
return implode(' ', $this->Company()->Employees()->column('Name'));
}
}

0 comments on commit dc3f096

Please sign in to comment.