projects
/
Pman.Core
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f7439d8
)
lookup for owner
author
Alan
<alan@roojs.com>
Wed, 28 Dec 2022 07:11:07 +0000
(15:11 +0800)
committer
Alan
<alan@roojs.com>
Wed, 28 Dec 2022 07:11:07 +0000
(15:11 +0800)
DataObjects/Core_company.php
patch
|
blob
|
history
Images.php
patch
|
blob
|
history
diff --git
a/DataObjects/Core_company.php
b/DataObjects/Core_company.php
index
054c0e8
..
c9b31ee
100644
(file)
--- a/
DataObjects/Core_company.php
+++ b/
DataObjects/Core_company.php
@@
-497,6
+497,26
@@
class Pman_Core_DataObjects_Core_Company extends DB_DataObject
$companies->insert();
$companies->onInsert(array(), $roo);
}
$companies->insert();
$companies->onInsert(array(), $roo);
}
+
+ function owner()
+ {
+ if (empty($this->owner_id)) {
+ return false;
+ }
+ static $cache = false;
+ if ($cache !== false && isset($cache[$this->owner_id])) {
+ return $cache[$this->owner_id];
+ }
+ $o = DB_DataObject::factory('core_company');
+ if (!$o->get($this->owner_id)) {
+ return false;
+ }
+ $cache[$this->owner_id] = $o;
+ return $o;
+
+ }
+
+ /// look up the company which is the system owner...
static function lookupOwner()
{
static $cache = false;
static function lookupOwner()
{
static $cache = false;
diff --git
a/Images.php
b/Images.php
index
eff84f5
..
e0527a0
100644
(file)
--- a/
Images.php
+++ b/
Images.php
@@
-126,7
+126,7
@@
class Pman_Core_Images extends Pman
}
if (strpos($id,':') > 0) { // id format tablename:id:-imgtype
}
if (strpos($id,':') > 0) { // id format tablename:id:-imgtype
-
+ //DB_DataObject::debugLevel(1);
if (!$this->authUser) {
$this->imgErr("not-authenticated-using-colon-format",$s);
if (!$this->authUser) {
$this->imgErr("not-authenticated-using-colon-format",$s);
@@
-150,6
+150,7
@@
class Pman_Core_Images extends Pman
}
$img->limit(1);
if (!$img->find(true)) {
}
$img->limit(1);
if (!$img->find(true)) {
+ die("HERE");
$this->imgErr("no images for that item: " . htmlspecialchars($id),$s);
}
$this->imgErr("no images for that item: " . htmlspecialchars($id),$s);
}